Adds testing coverage of parsing the celery beat schedule

This commit is contained in:
Trenton H
2023-01-05 08:25:35 -08:00
parent 19ab62c06c
commit 9763b72f81
2 changed files with 136 additions and 0 deletions

View File

@@ -141,9 +141,15 @@ def _parse_beat_schedule() -> Dict:
},
]
for task in tasks:
# Either get the environment setting or use the default
value = os.getenv(task["env_key"], task["env_default"])
# Don't add disabled tasks to the schedule
if value == "disable":
continue
# I find https://crontab.guru/ super helpful
# crontab(5) format
# - five time-and-date fields
# - separated by at least one blank
minute, hour, day_month, month, day_week = value.split(" ")
schedule[task["name"]] = {
"task": task["task"],