Harden Celery schedule parsing and startup safety
This commit is contained in:
@ -31,6 +31,18 @@ def test_build_periodic_schedule_disabled(settings):
|
||||
assert build_periodic_schedule() == {}
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_build_periodic_schedule_invalid_cron_disables_task_and_logs(settings, caplog):
|
||||
settings.INGESTION_SCHEDULE_ENABLED = True
|
||||
settings.INGESTION_SCHEDULE_CRON = "invalid-cron"
|
||||
|
||||
with caplog.at_level("ERROR"):
|
||||
schedule = build_periodic_schedule()
|
||||
|
||||
assert schedule == {}
|
||||
assert any("Invalid periodic ingestion schedule config. Task disabled." in message for message in caplog.messages)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_trigger_incremental_sync_skips_overlapping_runs(settings):
|
||||
settings.INGESTION_PREVENT_OVERLAP = True
|
||||
|
||||
Reference in New Issue
Block a user