Open joshtrichards opened 3 months ago
Does that mean that previous downloads for other upgrades will stack up and eat up disk space?
Under some circumstances, yes. But we're also already leaving Archive files around today whenever there are failures before/ during the extraction step (either until the next Updater run or forever if a manual update is used after the Updater fails). If those are of concern we should probably just add a background job to clean them up.
/downloads/
folder (including /downloads/nextcloud/
) is already left empty and what I removed was a no-op under those circumstances/downloads/
by resuming or re-using it rather than deleting it only to re-download it again immediately after/downloads/nextcloud/
) is not empty and that is bad [This is the issue I hinted at in my follow-up edit. It's probably the main thing that fully wiping of /downloads/
here was saving us from.]To keep this PR from introducing any new potential problems we were previously saving ourselves from, I'll re-add clean-up at the top of the extractDownload()
, but only specifically of the /downloads/nextcloud/
folder. This will still leave any Archive zip files in /downloads/
alone.
Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
Looks good, but seems like there is a lot of duplicated code. Could we move them to third file?
It’s not duplicated index.php is built with make and contains the other file. Unless I misunderstood what you’re talking about?
What it does:
updater.log
(in 2% increments until reaching 10% then 10% increments after that)updater.log
upon completion (bytes downloaded, total time, average speed)TODO (before merging):
Example log (with a partial previous download detected):
Most material change this makes internally: We no longer delete the
/downloads/
storage location if it exists. Instead we delete only the extracted archive contents sub-folder (/downloads/nextcloud/
).This was obviously necessary for the resume to work (since we want the Archive zip).
We still clean-up
/downloads/nextcloud/
(just not the whole/downloads/
folder) in case the Updater fails at later steps and leaves the extracted contents around.Follow-up PR ideas:
finalize()
step. The downside being that ~250MB would be consumed until the Updater finishes rather than being freed up at the extraction stage. I don't know how to decide whether that's reasonable or not for all the different environments we try to support. So I tried to keep this PR conservative. Technically that space already had be available in the environment because the extraction step itself requires space for the Archive + the extracted contents since both must co-exist until the extraction is successful. Therefore I think it'd be safe move that clean-up tofinalize()
. But with the Updater being a very sensitive area I figured... maybe a follow-up PR tweaking that makes more sense. :)