From 3456bd21ae2157d518ae8061050c0e8df03f7292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sun, 23 Feb 2025 23:14:10 +0100 Subject: [PATCH] fix cron on start --- app.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 009fae8..dd0dfcb 100644 --- a/app.py +++ b/app.py @@ -601,17 +601,18 @@ def cleanup_old_logs(): ############################################################################### # Konfiguracja APScheduler - harmonogram zadań ############################################################################### -scheduler = BackgroundScheduler() +#scheduler = BackgroundScheduler() # Dodajemy dwa zadania cykliczne: # 1) Czyszczenie starych backupów (default co 1 dzień) # 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()) @@ -1392,7 +1393,7 @@ def delete_old_logs(): if __name__ == '__main__': with app.app_context(): - #scheduler = BackgroundScheduler() + scheduler = BackgroundScheduler() schedule_retention_job() schedule_auto_export_job() schedule_auto_binary_backup_job()