fix cron on start

This commit is contained in:
Mateusz Gruszczyński 2025-02-23 23:19:33 +01:00
parent c9a5bfaaf8
commit 0a9b0f22b8

6
app.py
View File

@ -608,9 +608,9 @@ scheduler = BackgroundScheduler()
# 2) Auto-backup (default co 1 dzień)
# Dodajemy z unikalnymi ID, co ułatwia re-schedulowanie
#scheduler.add_job(func=cleanup_old_backups, trigger='interval', days=1, id="cleanup_job")
#scheduler.add_job(func=scheduled_auto_backup, trigger='interval', days=1, id="auto_backup_job")
#scheduler.start()
scheduler.add_job(func=cleanup_old_backups, trigger='interval', days=1, id="cleanup_job")
scheduler.add_job(func=scheduled_auto_backup, trigger='interval', days=1, id="auto_backup_job")
scheduler.start()
# Sprzątanie przy zamykaniu
atexit.register(lambda: scheduler.shutdown())