Using Extension.version to decide current running version, fixes #499
This commit is contained in:
@ -100,18 +100,6 @@ class IrisCore(pykka.ThreadingActor):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
##
|
|
||||||
# Load version number from file
|
|
||||||
#
|
|
||||||
# @return String
|
|
||||||
##
|
|
||||||
def load_version(self):
|
|
||||||
file_path = pathlib.Path(__file__).parent.parent / "IRIS_VERSION"
|
|
||||||
try:
|
|
||||||
return file_path.read_text()
|
|
||||||
except Exception:
|
|
||||||
return "Unknown"
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Generate a random string
|
# Generate a random string
|
||||||
#
|
#
|
||||||
@ -427,7 +415,7 @@ class IrisCore(pykka.ThreadingActor):
|
|||||||
http_response = await http_client.fetch(url)
|
http_response = await http_client.fetch(url)
|
||||||
response_body = json.loads(http_response.body)
|
response_body = json.loads(http_response.body)
|
||||||
latest_version = response_body["info"]["version"]
|
latest_version = response_body["info"]["version"]
|
||||||
current_version = self.load_version()
|
current_version = Extension.version
|
||||||
|
|
||||||
# compare our versions, and convert result to boolean
|
# compare our versions, and convert result to boolean
|
||||||
upgrade_available = parse_version(latest_version) > parse_version(
|
upgrade_available = parse_version(latest_version) > parse_version(
|
||||||
|
|||||||
Reference in New Issue
Block a user