Optimize replay file deletion #779
Labels
Blocked: Needs more info
This is lacking essential information like steps to recreate or a video showing reported behavior.
For: Backend
This is something to do for the backend (server folder) of the website.
Priority: Medium
Something that should be tried to be done in this release, but not as important as High priority.
Size: Medium
Something that may take a few days or so to implement.
Type: Enhancement
Something that builds on top of what already exists
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.The text was updated successfully, but these errors were encountered: