Make automatic deletion of unclaimed recordings a 2-step process #426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously,
ASCIICAST_GC_DAYS
variable was used to control max age of unclaimed recordings, after which they were soft-deleted, i.e. marked as "archived" (confusing term), effectively making them inaccessible by de-listing them and showing 410 Gone page for direct recording links.This PR implements 2-step deletion process. It introduces new config variable,
UNCLAIMED_RECORDING_TTL
, which controls the behaviour of automatic removal of unclaimed recordings.Step 1 is soft-deletion, which is what we had previously. Also, we now use term "deletion" instead of "archival", because "archival" confused people, making them think the recordings are put in some sort of archive, while in fact they were just hidden and waiting for proper deletion.
Step 2 is hard-deletion, which removes any traces of a recording from the system (deleting DB records + recording file).
UNCLAIMED_RECORDING_TTL
accepts TTL values in days, in the following formats:UNCLAIMED_RECORDING_TTL=7
- soft-deletion after 7 days, no hard-deletionUNCLAIMED_RECORDING_TTL=7,30
- soft-deletion after 7 days, hard-deletion after 30 daysUNCLAIMED_RECORDING_TTL=7,7
- hard-deletion after 7 days (soft-deletion would be the same therefore doesn't apply)UNCLAIMED_RECORDING_TTL
is not set - no auto-deletion whatsoeverThe benefit of having 2-step auto-deletion process like this, especially for a main asciinema server instance - asciinema.org - is to give people time to reach out to the server admin until it's too late to recover the recording.
On asciinema.org we used
ASCIICAST_GC_DAYS=7
and I plan to replace it with something likeUNCLAIMED_RECORDING_TTL=7,90
.