mirror of
https://github.com/himanshugoel2797/MisskeyBooruImageBot.git
synced 2024-10-22 23:29:06 +00:00
Account for invalid time values properly.
This commit is contained in:
parent
a68470a344
commit
4fdc11952e
1 changed files with 1 additions and 1 deletions
|
@ -206,7 +206,7 @@ def main():
|
||||||
for key in defaults:
|
for key in defaults:
|
||||||
if key not in cfg_tmp:
|
if key not in cfg_tmp:
|
||||||
cfg_tmp[key] = defaults[key]
|
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
|
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:
|
if cfg_tmp['last_run_time'] != -1 and time.time() - cfg_tmp['last_run_time'] < 60 * 60:
|
||||||
|
|
Loading…
Reference in a new issue