hard exit when services fail

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-09-19 14:25:22 +02:00
parent 2d3133b8a5
commit 1f1aa50c54
33 changed files with 48 additions and 0 deletions
+3
View File
@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -75,6 +76,7 @@ func Server(cfg *config.Config) *cli.Command {
servers.Add(httpServer.Run, func(_ error) {
logger.Info().Str("server", "http").Msg("Shutting down server")
cancel()
os.Exit(1)
})
// prepare a gRPC server and add it to the group run.
@@ -90,6 +92,7 @@ func Server(cfg *config.Config) *cli.Command {
servers.Add(grpcServer.Run, func(_ error) {
logger.Info().Str("server", "grpc").Msg("Shutting down server")
cancel()
os.Exit(1)
})
// prepare a debug server and add it to the group run.