diff --git a/pialert/__main__.py b/pialert/__main__.py index 57dcf91a..3b7c54d4 100755 --- a/pialert/__main__.py +++ b/pialert/__main__.py @@ -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) diff --git a/pialert/helper.py b/pialert/helper.py index a25796a9..7aa654d6 100755 --- a/pialert/helper.py +++ b/pialert/helper.py @@ -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