Delete old download files from frontend server
Created by: das-g
As an operator, I don't want export results (large-ish ZIP archives) to take up disk space forever. They should be deleted automatically somewhen to make space for new results.
As a user, want to have the result files available for a set minimum time after I'm notified that they've become available, so I can
- come and get them later, in case I can't or don't want to react to the notification right away
- send the download links to others who'll then also have enough time to go get the files if they want
- re-download recent files in case I loose or destroy my local copy, or don't have the drive I've put them on with me and need the file on another device
For this, I'd like to know how long (and/or even better, until when) a given file will at least be available.
Implementation notes:
- Downloads expire after a given constant (configurable by setting) time after the user has been first notified about them (note that notification time might be considerably after creation time)
- Download expiration time: 1 month
- Each file's expiration date should be explicitly stored, so that it won't change for existing files when the setting is adapted
- Expiry date (and maybe minimum availability duration, too) should be visible on
-
the order's page, in the email the orderer receives - in the emails the orderer can send do others
-
everywhere else where there's a link to individual downloads.
-
- A cron job is probably overkill for this. Old files could be identified and deleted when we're about to create new ones