a8n: Delete expired CampaignPlans in background
Created by: mrnugget
A CampaignPlan
is expired when
- all its
CampaignJobs
have finished execution - they have finished > 1 hour ago
- the
CampaignPlan
has not been attached to aCampaign
In the background of the enterprise repo-updater
(since its a single instance) now runs a goroutine that deletes these expired CampaignPlan
s every 2 minutes.
What's still missing: the tests that make sure a CampaignPlan
is not deleted when attached to a Campaign
. That depends on changes to the a8n.Store
that @tsenart made in another branch that hasn't been merged yet. But... the test is also not really strictly necessary, so, ready for review.