Skip to content

a8n: Delete expired CampaignPlans in background

Warren Gifford requested to merge a8n/delete-expired-plans into master

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 a Campaign

In the background of the enterprise repo-updater (since its a single instance) now runs a goroutine that deletes these expired CampaignPlans 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.

Merge request reports

Loading