mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Merge branch 'crontab' into 'master'
Crontab See merge request allianceauth/allianceauth!1695
This commit is contained in:
commit
3818d0c6d1
@ -44,6 +44,7 @@ class OffsetDatabaseScheduler(DatabaseScheduler):
|
|||||||
entry = self.Entry.from_entry(name, app=self.app, **entry_fields)
|
entry = self.Entry.from_entry(name, app=self.app, **entry_fields)
|
||||||
|
|
||||||
if apply_offset:
|
if apply_offset:
|
||||||
|
entry_fields.update({"apply_offset": apply_offset}) # Reapply this as its gets pulled from config inconsistently.
|
||||||
schedule_obj = entry.schedule
|
schedule_obj = entry.schedule
|
||||||
if isinstance(schedule_obj, schedules.crontab):
|
if isinstance(schedule_obj, schedules.crontab):
|
||||||
offset_cs = CrontabSchedule.from_schedule(offset_cron(schedule_obj))
|
offset_cs = CrontabSchedule.from_schedule(offset_cron(schedule_obj))
|
||||||
@ -55,6 +56,7 @@ class OffsetDatabaseScheduler(DatabaseScheduler):
|
|||||||
day_of_week=offset_cs.day_of_week,
|
day_of_week=offset_cs.day_of_week,
|
||||||
timezone=offset_cs.timezone,
|
timezone=offset_cs.timezone,
|
||||||
)
|
)
|
||||||
|
entry.schedule = offset_cron(schedule_obj) # This gets passed into Celery Beats Memory, important to keep it in sync with the model/DB
|
||||||
entry.model.crontab = offset_cs
|
entry.model.crontab = offset_cs
|
||||||
entry.model.save()
|
entry.model.save()
|
||||||
logger.debug(f"Offset applied for '{name}' due to 'apply_offset' = True.")
|
logger.debug(f"Offset applied for '{name}' due to 'apply_offset' = True.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user