Skip to content

Commit f4061d7

Browse files
committed
Drop timeout for requests made to the internal hook api
1 parent 5407382 commit f4061d7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

modules/private/hook.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"context"
88
"fmt"
99
"net/url"
10-
"time"
1110

1211
"code.gitea.io/gitea/modules/git"
1312
"code.gitea.io/gitea/modules/repository"
@@ -86,7 +85,6 @@ type HookProcReceiveRefResult struct {
8685
func HookPreReceive(ctx context.Context, ownerName, repoName string, opts HookOptions) ResponseExtra {
8786
reqURL := setting.LocalURL + fmt.Sprintf("api/internal/hook/pre-receive/%s/%s", url.PathEscape(ownerName), url.PathEscape(repoName))
8887
req := newInternalRequestAPI(ctx, reqURL, "POST", opts)
89-
req.SetReadWriteTimeout(time.Duration(60+len(opts.OldCommitIDs)) * time.Second)
9088
_, extra := requestJSONResp(req, &ResponseText{})
9189
return extra
9290
}
@@ -95,7 +93,6 @@ func HookPreReceive(ctx context.Context, ownerName, repoName string, opts HookOp
9593
func HookPostReceive(ctx context.Context, ownerName, repoName string, opts HookOptions) (*HookPostReceiveResult, ResponseExtra) {
9694
reqURL := setting.LocalURL + fmt.Sprintf("api/internal/hook/post-receive/%s/%s", url.PathEscape(ownerName), url.PathEscape(repoName))
9795
req := newInternalRequestAPI(ctx, reqURL, "POST", opts)
98-
req.SetReadWriteTimeout(time.Duration(60+len(opts.OldCommitIDs)) * time.Second)
9996
return requestJSONResp(req, &HookPostReceiveResult{})
10097
}
10198

@@ -104,7 +101,6 @@ func HookProcReceive(ctx context.Context, ownerName, repoName string, opts HookO
104101
reqURL := setting.LocalURL + fmt.Sprintf("api/internal/hook/proc-receive/%s/%s", url.PathEscape(ownerName), url.PathEscape(repoName))
105102

106103
req := newInternalRequestAPI(ctx, reqURL, "POST", opts)
107-
req.SetReadWriteTimeout(time.Duration(60+len(opts.OldCommitIDs)) * time.Second)
108104
return requestJSONResp(req, &HookProcReceiveResult{})
109105
}
110106

0 commit comments

Comments
 (0)