Skip to content

Commit

Permalink
tag_name
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-zehentleitner committed May 14, 2024
1 parent 86fd2da commit 3373173
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions unicorn_fy/unicorn_fy.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class UnicornFy(object):

def __init__(self, debug=False):
self.last_update_check_github = {'timestamp': time.time(),
'status': None}
'status': {'tag_name': None}}
self.name = __app_name__
self.version = __version__

Expand Down Expand Up @@ -1272,12 +1272,12 @@ def get_latest_version(self):
:return: str or False
"""
# Do a fresh request if status is None or last timestamp is older 1 hour
if self.last_update_check_github['status'] is None or \
if self.last_update_check_github['status']['tag_name'] is None or \
(self.last_update_check_github['timestamp'] + (60 * 60) < time.time()):
self.last_update_check_github['status'] = self.get_latest_release_info()
if self.last_update_check_github['status']:
try:
return self.last_update_check_github['status']["tag_name"]
return self.last_update_check_github['status'].get("tag_name")
except KeyError:
return "unknown"
else:
Expand Down

0 comments on commit 3373173

Please sign in to comment.