guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 120 forks source link

[reaper] add `batchSoftDelete` and `batchHardDelete` endpoints (batches of up to 1000) #4134

Closed twrichards closed 11 months ago

twrichards commented 1 year ago

The 'reaper' has been turned off for many years and its implementation was never the most efficient. Thanks to the work in previous PRs (notably https://github.com/guardian/grid/pull/3926) we can easily filter for images which meet the criteria for 'reaping'.

The new approach will first 'soft delete' reapable images for two weeks, so they're not visible in the grid UI (unless the is:deleted filter is applied, note all queries have -is:deleted by default) and so there's a place to view the candidates for hard deletion for a period of time before they're actually hard deleted.

This PR introduces, four new media-api endpoints...

... these will be primarily utilised by a re-write of the scheduled 'reaper' lambda (see https://github.com/guardian/grid/pull/4135).

Note, thanks to #4128 we have a way to restore images even once they've been hard deleted 🪄

twrichards commented 11 months ago

Closing in favour of a consolidated approach entirely within thrall - see https://github.com/guardian/grid/pull/4145