mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Version check debug
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user