[FIX] LEAVE: Fixed leave expiry date scheduler issue

This commit is contained in:
Horilla
2025-03-07 10:02:52 +05:30
parent ccbd141a45
commit f2d07b9b34
3 changed files with 187 additions and 131 deletions

View File

@@ -40,6 +40,11 @@ if not any(
Initializes and starts background tasks using APScheduler when the server is running.
"""
scheduler = BackgroundScheduler()
scheduler.add_job(create_work_record, "interval", hours=3)
scheduler.add_job(
create_work_record, "interval", hours=3, misfire_grace_time=3600 * 3
)
scheduler.add_job(
create_work_record, "cron", hour=0, minute=30, misfire_grace_time=3600 * 9
)
scheduler.start()