Skip to content

Commit 13df0cc

Browse files
committed
set no timeout for resotre repo private request
1 parent 2f06f4f commit 13df0cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/private/restore_repo.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"io/ioutil"
1010
"net/http"
11+
"time"
1112

1213
"code.gitea.io/gitea/modules/setting"
1314
jsoniter "github.com/json-iterator/go"
@@ -26,6 +27,7 @@ func RestoreRepo(repoDir, ownerName, repoName string, units []string) (int, stri
2627
reqURL := setting.LocalURL + "api/internal/restore_repo"
2728

2829
req := newInternalRequest(reqURL, "POST")
30+
req.SetTimeout(3*time.Second, 0) // since the request will spend much time, don't timeout
2931
req = req.Header("Content-Type", "application/json")
3032
json := jsoniter.ConfigCompatibleWithStandardLibrary
3133
jsonBytes, _ := json.Marshal(RestoreParams{

0 commit comments

Comments
 (0)