From b14aea666717ae5878613c4191dc03fb71ed3508 Mon Sep 17 00:00:00 2001 From: Samuel Jones Date: Thu, 15 Feb 2024 13:57:52 +0000 Subject: [PATCH] better handle 'none' in the db --- file_watcher/lastrun_file_monitor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file_watcher/lastrun_file_monitor.py b/file_watcher/lastrun_file_monitor.py index 9eac0f4..5156a8f 100644 --- a/file_watcher/lastrun_file_monitor.py +++ b/file_watcher/lastrun_file_monitor.py @@ -47,7 +47,8 @@ def __init__( self.db_updater = DBUpdater(ip=db_ip, username=db_username, password=db_password) self.latest_known_run_from_db = self.get_latest_run_from_db() logger.info("Last run in DB is: %s", self.latest_known_run_from_db) - if self.latest_known_run_from_db is None: + if (self.latest_known_run_from_db is None + or self.latest_known_run_from_db == 'None'): logger.info("Adding latest run to DB as there is no data: %s", self.last_recorded_run_from_file) self.update_db_with_latest_run(self.last_recorded_run_from_file) self.latest_known_run_from_db = self.last_recorded_run_from_file