Fix package upload temp path (#34196)

Fix #34195

The temp dir should be created when it is used.
This commit is contained in:
wxiaoguang authored and GitHub committed 2025-04-14 18:55:02 +08:00
1 parent f6474cf2e9
commit 58a3952458
2 files changed
+17 -16

No files matched your search

+2 -10
View File
@@ -13,9 +13,8 @@ import (
// Package registry settings
var (
Packages = struct {
Storage *Storage
Enabled bool
ChunkedUploadPath string
Storage *Storage
Enabled bool
LimitTotalOwnerCount int64
LimitTotalOwnerSize int64
@@ -65,13 +64,6 @@ func loadPackagesFrom(rootCfg ConfigProvider) (err error) {
return err
}
if HasInstallLock(rootCfg) {
Packages.ChunkedUploadPath, err = AppDataTempDir("package-upload").MkdirAllSub("")
if err != nil {
return fmt.Errorf("unable to create chunked upload directory: %w", err)
}
}
Packages.LimitTotalOwnerSize = mustBytes(sec, "LIMIT_TOTAL_OWNER_SIZE")
Packages.LimitSizeAlpine = mustBytes(sec, "LIMIT_SIZE_ALPINE")
Packages.LimitSizeArch = mustBytes(sec, "LIMIT_SIZE_ARCH")