fix cron on start
This commit is contained in:
parent
27f969cc4b
commit
3456bd21ae
11
app.py
11
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user