From 66f8f2dffd46b4d6ee19ace6cf6aa4e6d6064b9b Mon Sep 17 00:00:00 2001 From: pengpengfu <35413731+bigbird-0101@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:31:26 +0800 Subject: [PATCH] fetcher when call uploadHandler ,archive zip, Use newZip instead of the default DefaultZip to improve the fetcher to accept more upload requests. (#2955) --- pkg/fetcher/fetcher.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/fetcher/fetcher.go b/pkg/fetcher/fetcher.go index d7040443f..93de0bb69 100644 --- a/pkg/fetcher/fetcher.go +++ b/pkg/fetcher/fetcher.go @@ -611,12 +611,16 @@ func (fetcher *Fetcher) archive(src string, dst string) error { } else { files = append(files, src) } - return archiver.DefaultZip.Archive(files, dst) + zip := archiver.NewZip() + defer zip.Close() + return zip.Archive(files, dst) } // unarchive is a function that unzips a zip file to destination func (fetcher *Fetcher) unarchive(src string, dst string) error { - err := archiver.DefaultZip.Unarchive(src, dst) + zip := archiver.NewZip() + defer zip.Close() + err := zip.Unarchive(src, dst) if err != nil { return fmt.Errorf("failed to unzip file: %w", err) }