Skip to content
Snippets Groups Projects
Unverified Commit 6ba2c199 authored by James Liu's avatar James Liu
Browse files

gitaly/config: Replace hardcoded timeouts with cfg

Replaces the previous hardcoded timeouts for `git-upload-pack` and
`git-upload-archive` with values pulled from the TOML configuration. If
no values were provided by the user, default values are set in the `Cfg`
struct.
parent ee8d08fc
No related merge requests found
......@@ -12,11 +12,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"
)
var (
defaultUploadPackRequestTimeout = 10 * time.Minute
defaultUploadArchiveRequestTimeout = time.Minute
)
type server struct {
gitalypb.UnimplementedSSHServiceServer
locator storage.Locator
......@@ -34,10 +29,10 @@ func NewServer(deps *service.Dependencies, serverOpts ...ServerOpt) gitalypb.SSH
gitCmdFactory: deps.GetGitCmdFactory(),
txManager: deps.GetTxManager(),
uploadPackRequestTimeoutTickerFactory: func() helper.Ticker {
return helper.NewTimerTicker(defaultUploadPackRequestTimeout)
return helper.NewTimerTicker(time.Duration(deps.Cfg.Timeout.UploadPack) * time.Minute)
},
uploadArchiveRequestTimeoutTickerFactory: func() helper.Ticker {
return helper.NewTimerTicker(defaultUploadArchiveRequestTimeout)
return helper.NewTimerTicker(time.Duration(deps.Cfg.Timeout.UploadArchive) * time.Minute)
},
packfileNegotiationMetrics: prometheus.NewCounterVec(
prometheus.CounterOpts{},
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment