diff options
-rw-r--r-- | internal/cli/gitaly/serve.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/cli/gitaly/serve.go b/internal/cli/gitaly/serve.go index fd4470241..d90460910 100644 --- a/internal/cli/gitaly/serve.go +++ b/internal/cli/gitaly/serve.go @@ -210,6 +210,15 @@ func run(cfg config.Cfg, logger logrus.FieldLogger) error { commandFactoryOpts = append(commandFactoryOpts, git.WithSkipHooks()) } + commandKillWait := (cfg.GracefulRestartTimeout.Duration() * 3) / 4 + commandFactoryOpts = append( + commandFactoryOpts, + git.WithKillFunc( + time.After(commandKillWait), + helper.NewTimerTicker(commandKillWait/5), + ), + ) + gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, logger, commandFactoryOpts...) if err != nil { return fmt.Errorf("creating Git command factory: %w", err) |