Maven Virtual Registry: Cleanup background job to remove marked cached responses
🔥 Problem
Follow up of Maven Registry: Cached responses destruction (#468113 - closed).
In Maven Registry: Cached responses destruction (#468113 - closed), Maven virtual registries will be marked for destruction.
The actual destruction should be carried out by a background job (cleaner).
🚒 Solution
- Have a cron job that will detect elements marked for destruction. If there is any work, enqueue the limited capacity job (see next point).
- Have a limited capacity job that will look for marked rows and destroy them, slowly one by one.
- Make sure that the object storage file is also destroyed. Eg. The ActiveRecord model should be instantiated and
#destroy!
should be called.
- Make sure that the object storage file is also destroyed. Eg. The ActiveRecord model should be instantiated and
⚙ Other technical aspects
At this point, it's not super clear if the limited capacity job is for the maven cached responses only (eg. one job class per format) or we can have a generic approach for any cached response.
This is an aspect that could be dealt with at a later time (when the second package format is implemented), so perhaps a job class for the maven cached responses is good enough for now.
Regarding the mark of cached responses that need to be destroyed, have a look at the work done for Maven Registry: Cached responses destruction (#468113 - closed) as we might have two different marks (status
column and upstream_id
).