Merge pull request #933 from LibreTranslate/copilot/fix-cuda-docker-image-issue

Fix BackgroundScheduler timezone auto-detection in CUDA Docker container
This commit is contained in:
Piero Toffanin 2026-02-06 23:24:25 -05:00 committed by GitHub
commit 7e82c2287d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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()

View File

@ -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)