alexhsamuel / apsis

General-purpose scheduler.
Other
3 stars 3 forks source link

clean up orphan jobs on archive #363

Closed alexhsamuel closed 3 weeks ago

alexhsamuel commented 4 weeks ago

After archiving runs, remove any adhoc jobs that no longer have associated runs. Something like:

DELETE FROM jobs
LEFT OUTER JOIN runs
ON runs.job_id = jobs.job_id
WHERE runs.run_id IS NULL

We should probably get rid of this table altogether, and use the copies attached to runs only.