Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0bfccd8

Browse files
Fix SSH LFS timeout (#34838) (#34842)
Backport#34838 by wxiaoguangFix#34834Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent534b9b3 commit0bfccd8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

‎modules/lfstransfer/backend/util.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func newInternalRequestLFS(ctx context.Context, internalURL, method string, head
132132
returnnil
133133
}
134134
req:=private.NewInternalRequest(ctx,internalURL,method)
135+
req.SetReadWriteTimeout(0)
135136
fork,v:=rangeheaders {
136137
req.Header(k,v)
137138
}

‎services/context/private.go‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,35 @@ func init() {
2828
})
2929
}
3030

31-
// Deadline is part of the interface for context.Context and we pass this to the request context
3231
func (ctx*PrivateContext)Deadline() (deadline time.Time,okbool) {
3332
ifctx.Override!=nil {
3433
returnctx.Override.Deadline()
3534
}
3635
returnctx.Base.Deadline()
3736
}
3837

39-
// Done is part of the interface for context.Context and we pass this to the request context
4038
func (ctx*PrivateContext)Done()<-chanstruct{} {
4139
ifctx.Override!=nil {
4240
returnctx.Override.Done()
4341
}
4442
returnctx.Base.Done()
4543
}
4644

47-
// Err is part of the interface for context.Context and we pass this to the request context
4845
func (ctx*PrivateContext)Err()error {
4946
ifctx.Override!=nil {
5047
returnctx.Override.Err()
5148
}
5249
returnctx.Base.Err()
5350
}
5451

55-
varprivateContextKeyany="default_private_context"
52+
typeprivateContextKeyTypestruct{}
53+
54+
varprivateContextKeyprivateContextKeyType
5655

57-
// GetPrivateContext returns a context for Private routes
5856
funcGetPrivateContext(req*http.Request)*PrivateContext {
5957
returnreq.Context().Value(privateContextKey).(*PrivateContext)
6058
}
6159

62-
// PrivateContexter returns apicontext as middleware
6360
funcPrivateContexter()func(http.Handler) http.Handler {
6461
returnfunc(next http.Handler) http.Handler {
6562
returnhttp.HandlerFunc(func(w http.ResponseWriter,req*http.Request) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp