MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _cleanup_orphaned_crontab

Function _cleanup_orphaned_crontab

core/scheduling.py:196–203  ·  view source on GitHub ↗

Delete a CrontabSchedule if no PeriodicTasks reference it.

(crontab_schedule)

Source from the content-addressed store, hash-verified

194
195
196def _cleanup_orphaned_crontab(crontab_schedule):
197 """Delete a CrontabSchedule if no PeriodicTasks reference it."""
198 if crontab_schedule is None:
199 return
200 if PeriodicTask.objects.filter(crontab=crontab_schedule).exists():
201 return
202 logger.debug(f"Cleaning up orphaned CrontabSchedule {crontab_schedule.id}")
203 crontab_schedule.delete()

Callers 2

delete_periodic_taskFunction · 0.85

Calls 3

existsMethod · 0.45
filterMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected