Version check debug

This commit is contained in:
Jokob-sk
2023-07-14 08:05:02 +10:00
parent 4a754cdae5
commit c9bc3e9447
2 changed files with 4 additions and 1 deletions

View File

@@ -131,6 +131,7 @@ def main ():
# check if new version is available / only check once an hour
# if newVersionAvailable is already true the function does nothing and returns true again
mylog('debug', [f"[Version check] Last version check timestamp: {last_version_check}"])
if last_version_check + datetime.timedelta(hours=1) < loop_start_time :
conf.newVersionAvailable = isNewVersion(conf.newVersionAvailable)

View File

@@ -194,6 +194,8 @@ def checkIPV4(ip):
#-------------------------------------------------------------------------------
def isNewVersion(newVersion: bool):
mylog('debug', [f"[Version check] New version available? {newVersion}"])
if newVersion == False:
f = open(pialertPath + '/front/buildtimestamp.txt', 'r')
@@ -218,7 +220,7 @@ def isNewVersion(newVersion: bool):
realeaseTimestamp = int(datetime.datetime.strptime(dateTimeStr, '%Y-%m-%dT%H:%M:%SZ').strftime('%s'))
if realeaseTimestamp > buildTimestamp + 600:
mylog('none', [" New version of the container available!"])
mylog('none', ["[Version check] New version of the container available!"])
newVersion = True
# updateState(db, 'Back_New_Version_Available', str(newVersionAvailable)) ## TO DO add this back in but avoid circular ref with database