0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-10-17 00:54:32 -04:00

Fix missing Close when error occurs and abused connection pool (#35658) (#35670)

Backport #35658
This commit is contained in:
wxiaoguang
2025-10-15 17:56:53 +08:00
committed by GitHub
parent 5ae9bb4df9
commit 53a2aaee35
7 changed files with 118 additions and 166 deletions

View File

@@ -6,7 +6,6 @@ package private
import (
"context"
"fmt"
"time"
"code.gitea.io/gitea/modules/setting"
)
@@ -31,6 +30,6 @@ func RestoreRepo(ctx context.Context, repoDir, ownerName, repoName string, units
Units: units,
Validation: validation,
})
req.SetTimeout(3*time.Second, 0) // since the request will spend much time, don't timeout
req.SetReadWriteTimeout(0) // since the request will spend much time, don't timeout
return requestJSONClientMsg(req, fmt.Sprintf("Restore repo %s/%s successfully", ownerName, repoName))
}