summaryrefslogtreecommitdiff
path: root/cmd/gitlab-sshd/main.go
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2022-05-19 13:04:25 +0400
committerIgor Drozdov <idrozdov@gitlab.com>2022-05-19 18:53:08 +0400
commitcbce19dac2b5033e6b969b3e82ec6aad2e247757 (patch)
tree10ed772a5bbb25589b22c375cfd1e638deba1452 /cmd/gitlab-sshd/main.go
parentbfa6fe4de784926cabd5bd5fd26eb6978c8095b9 (diff)
downloadgitlab-shell-cbce19dac2b5033e6b969b3e82ec6aad2e247757.tar.gz
Allow specifying formatted durations in config
- If an integer is specified, we assume that these are seconds - A duration of format "500ms", "10s", "1m", etc... accepted
Diffstat (limited to 'cmd/gitlab-sshd/main.go')
-rw-r--r--cmd/gitlab-sshd/main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/gitlab-sshd/main.go b/cmd/gitlab-sshd/main.go
index 8040a54..16fbca0 100644
--- a/cmd/gitlab-sshd/main.go
+++ b/cmd/gitlab-sshd/main.go
@@ -99,11 +99,12 @@ func main() {
sig := <-done
signal.Reset(syscall.SIGINT, syscall.SIGTERM)
- log.WithContextFields(ctx, log.Fields{"shutdown_timeout_s": cfg.Server.GracePeriodSeconds, "signal": sig.String()}).Info("Shutdown initiated")
+ gracePeriod := time.Duration(cfg.Server.GracePeriod)
+ log.WithContextFields(ctx, log.Fields{"shutdown_timeout_s": gracePeriod.Seconds(), "signal": sig.String()}).Info("Shutdown initiated")
server.Shutdown()
- <-time.After(cfg.Server.GracePeriod())
+ <-time.After(gracePeriod)
cancel()