1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix package upload temp path (#34196)

Fix #34195

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

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")