Skip to content

Commit

Permalink
better handle 'none' in the db
Browse files Browse the repository at this point in the history
  • Loading branch information
Pasarus committed Feb 15, 2024
1 parent 98b23d6 commit b14aea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion file_watcher/lastrun_file_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b14aea6

Please sign in to comment.