Closed tsa96 closed 3 months ago
Blocking for now; with ongoing replay work it's possible the size of replays end up decreasing to a point where we don't need to delete
Deleting in R2 is completely free: https://developers.cloudflare.com/r2/pricing/#free-operations
Oh I hadn't realised. Closing in that case, only case I'm concerned about multi-deletes will be when doing whole leaderboard deletions https://github.com/momentum-mod/website/issues/916, can tackle that there.
We'll be deleting a lot of replay files from S3, when a user PBs, and when maps are updated (changing state during map review, patching a map to fix a catastrophic bug). In the latter case we'd be reaaaaally hammering S3/R2 if we do individual deletes.
Also, we're going to be adding a
status
flag to each run in the future, likelyPENDING_VALIDATION
,APPROVED
. Can easily add another,PENDING_DELETION
. When a run is deleted, we just update the service toPENDING_DELETION
.Then, have a new service that uses NestJS's
@Cron
decorator from the scheduler that periodically, within an interactive transaction gets all runs marked asPENDING_DELETION
, creates a S3 delete multiple call, and assuming that's successful, actually deletes all those runs from DB, interactive transaction ends.