mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 14:13:26 +00:00
Useless download count tracking for files without a download limit #178
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JustAnotherArchivist on GitHub.
This is essentially an extension of #362, but I wanted to put this up for discussion first as it's not as clear-cut.
There is currently no mechanism for changing the download limit for a file short of manually manipulating the metadata file. For that reason, it's useless in my eyes to track the download count at all on files that don't have a download limit set as it will never be used. The main issue with that is that these needless writes may incur costs for the operator depending on the storage backend and traffic volume, e.g. when using AWS S3 (operation cost) or Wasabi S3 (minimum retention).
I suppose the key questions are: is there any intention to ever add support for changing the
MaxDownloadsafter upload? If not, is there any other reason for tracking the download count on files without a limit?(I'll happily provide a PR if the answer to both questions is no.)
@paolafrancesca commented on GitHub:
I'm fine without being able to change the
MaxDownloads, mostly because it was never a feature and nobody requested it (so, it's not a missing feature ;)), and to introduce it would require some logic for identifying the owner of the upload that would be allowed to change the value: that's far from straightforward.If I got right what your proposal is, it would be just a matter of checking
metadata.MaxDownloads != -1condition as well in theifthat you just refactored. Am I correct?@stefanbenten what do you think?
@JustAnotherArchivist commented on GitHub:
I suppose that could reuse the deletion token, so e.g. a PUT request against that URL with the new
MaxDownloadsvalue in a header, query, or body. But yeah, considering nobody asked for it in 6.5 years, it's probably not worth implementing.Yes, that's correct.
@stefanbenten commented on GitHub:
I think that is a totally fine approach!
Much appreciate the improvement proposal! 👍