return new version in is_updated

This commit is contained in:
simon 2023-02-02 12:06:24 +07:00
parent 83057d9e54
commit 114c7c2811
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -137,7 +137,7 @@ class AppConfig:
config = self.get_config()
config["scheduler"]["version_check"] = self._build_rand_daily()
RedisArchivist().set_message("config", config)
return
return False
needs_update = False
@ -160,6 +160,8 @@ class AppConfig:
if needs_update:
RedisArchivist().set_message("config", redis_config)
return needs_update
class ScheduleBuilder:
"""build schedule dicts for beat"""
@ -342,11 +344,13 @@ class ReleaseVersion:
"""check if update happened in the mean time"""
message = self.get_update()
if not message:
return
return False
if self._parse_version(message.get("version")) == self.local_version:
print(f"[{self.local_version}]: update completed")
RedisArchivist().del_message(self.NEW_KEY)
return settings.TA_VERSION
return False
def get_update(self):
"""return new version dict if available"""