diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2019-04-08 18:09:16 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2019-04-08 18:09:16 +0300 |
commit | 76fcd64e721cd4ec14a514c10e61659a949b7a60 (patch) | |
tree | 65d663f7e203a33a54a0ea63ee94360d586f6ae8 | |
parent | b28508f4db315abd601b5756b0c41aaf40e73655 (diff) |
Return error from Run()
-rw-r--r-- | cmd/gitaly/main.go | 4 | ||||
-rw-r--r-- | internal/bootstrap/bootstrap.go | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/cmd/gitaly/main.go b/cmd/gitaly/main.go index e97b7b2a2..29e3d2b81 100644 --- a/cmd/gitaly/main.go +++ b/cmd/gitaly/main.go @@ -209,9 +209,7 @@ func main() { log.WithError(err).Fatal("unable to start listeners") } - b.Run() - - log.Error("shutting down") + log.WithError(b.Run()).Error("shutting down") } func createUnixListener(listen bootstrap.ListenFunc, socketPath string, removeOld bool) (net.Listener, error) { diff --git a/internal/bootstrap/bootstrap.go b/internal/bootstrap/bootstrap.go index b883ac4f1..7c70635bb 100644 --- a/internal/bootstrap/bootstrap.go +++ b/internal/bootstrap/bootstrap.go @@ -122,14 +122,13 @@ func (b *Bootstrap) Start() error { return nil } -func (b *Bootstrap) Run() { +func (b *Bootstrap) Run() error { signals := []os.Signal{syscall.SIGTERM, syscall.SIGINT} immediateShutdown := make(chan os.Signal, len(signals)) signal.Notify(immediateShutdown, signals...) if err := b.upgrader.Ready(); err != nil { - log.WithError(err).Error("incomplete bootstrap") - return + return err } var err error @@ -149,7 +148,7 @@ func (b *Bootstrap) Run() { close(b.Stop) - log.WithError(err).Error("terminating") + return err } func (b *Bootstrap) waitGracePeriod(kill <-chan os.Signal) { |