mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Set context for running CreateArchive in to that of the request (#12555)
Set the context for CreateArchive to that of the request to ensure that archives are only built for as long as a request is requesting them Fix #11551 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@@ -524,7 +524,7 @@ func Download(ctx *context.Context) {
|
||||
|
||||
archivePath = path.Join(archivePath, base.ShortSha(commit.ID.String())+ext)
|
||||
if !com.IsFile(archivePath) {
|
||||
if err := commit.CreateArchive(archivePath, git.CreateArchiveOpts{
|
||||
if err := commit.CreateArchive(ctx.Req.Context(), archivePath, git.CreateArchiveOpts{
|
||||
Format: archiveType,
|
||||
Prefix: setting.Repository.PrefixArchiveFiles,
|
||||
}); err != nil {
|
||||
|
Reference in New Issue
Block a user