mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2026-02-07 11:33:38 -05:00
Fix CUDA docker timezone issue by explicitly setting UTC timezone in BackgroundScheduler
Co-authored-by: pierotofy <1951843+pierotofy@users.noreply.github.com>
This commit is contained in:
parent
6dfccf5695
commit
ac0f15a51d
@ -18,7 +18,7 @@ def remove_translated_files(upload_dir: str):
|
||||
|
||||
|
||||
def setup(upload_dir):
|
||||
scheduler = BackgroundScheduler(daemon=True)
|
||||
scheduler = BackgroundScheduler(daemon=True, timezone='UTC')
|
||||
scheduler.add_job(remove_translated_files, "interval", minutes=30, kwargs={'upload_dir': upload_dir})
|
||||
scheduler.start()
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ def setup(args):
|
||||
global scheduler
|
||||
|
||||
if scheduler is None:
|
||||
scheduler = BackgroundScheduler()
|
||||
scheduler = BackgroundScheduler(timezone='UTC')
|
||||
|
||||
if not args.secondary and args.req_flood_threshold > 0:
|
||||
scheduler.add_job(func=forgive_banned, trigger="interval", minutes=10)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user