From 4fdc11952e7d7dd6148184e8af896e3e9bc453e3 Mon Sep 17 00:00:00 2001 From: Himanshu Goel Date: Mon, 9 Oct 2023 14:24:31 -0400 Subject: [PATCH] Account for invalid time values properly. --- gelbooru_poster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gelbooru_poster.py b/gelbooru_poster.py index 1a7087e..e5aebed 100644 --- a/gelbooru_poster.py +++ b/gelbooru_poster.py @@ -206,7 +206,7 @@ def main(): for key in defaults: if key not in cfg_tmp: cfg_tmp[key] = defaults[key] - if cfg_tmp['last_run_time'] == -1: + if cfg_tmp['last_run_time'] == -1 or cfg_tmp['last_run_time'] > time.time() + 60 * 60: # If last run time is in the future, set it to 1 hour ago cfg_tmp['last_run_time'] = time.time() - 60 * 60 if cfg_tmp['last_run_time'] != -1 and time.time() - cfg_tmp['last_run_time'] < 60 * 60: