Description
Hi,
This is something I intend to look at, but filing an issue for it in case others have thoughts; basically, for large repos/branches, downloading the branch may take a long time creating the .zip archive on the backend. There are actually two related issues here, that I think have the same solution:
1.) We may timeout on the download if the archive's not been created yet, and
2.) Gitea may handout an archive that's not yet complete
I think the solution is to push archiving into a queue and make this an async process that checks in for completion; then the download endpoint can check if archiving this particular commit/branch is in progress rather than handing out an incomplete archive.
This can be observed on lower-end hardware and/or with large repos, e.g. any of the branches here on my instance: https://git.kevans.dev/kevans/freebsd/branches/ -> these should all hit nginx's default timeout (and actually caused a DoS of sorts when people were apparently attempting to download one of my branches). I'd push it to try.gitea.io, but I think the problem is easily enough visualized to not need to push the ~2-4GB repo over there.