mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
feat(automations): add schedule trigger source, selector and inputs
This commit is contained in:
parent
f293aa6bdf
commit
b1642993ba
3 changed files with 229 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
"""Schedule trigger source: Celery Beat ticks the selector every minute.
|
||||
|
||||
``BEAT_SCHEDULE`` is merged into ``celery_app.conf.beat_schedule``. Per-row cron
|
||||
math is precomputed (the ``next_fire_at`` column), so each tick is an indexed
|
||||
lookup rather than N cron evaluations.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from celery.schedules import crontab
|
||||
|
||||
TASK_NAME = "automation_schedule_select"
|
||||
|
||||
BEAT_SCHEDULE = {
|
||||
"automation-schedule-select": {
|
||||
"task": TASK_NAME,
|
||||
"schedule": crontab(minute="*"),
|
||||
"options": {"expires": 50},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue