Co-authored-by: Jörn Dreyer <jfd@butonic.de>
Signed-off-by: Christian Richter <c.richter@opencloud.eu>
This commit is contained in:
Christian Richter
2026-04-20 15:24:36 +02:00
committed by Christian Richter
parent 3b8d5ed8d6
commit c329439aac
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"time"
"github.com/opencloud-eu/opencloud/opencloud/pkg/command"
)
@@ -12,4 +13,10 @@ func main() {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
// INFO: this is a hotfix, we need to replace suture and wait for nats to
// gracefully shutdown using rungroups
// see https://github.com/opencloud-eu/opencloud/issues/2282
fmt.Println("Waiting for 30 seconds before exiting...")
time.Sleep(30 * time.Second)
fmt.Println("Exiting...")
}
+7
View File
@@ -5,6 +5,7 @@ import (
"crypto/tls"
"fmt"
"os/signal"
"time"
"github.com/opencloud-eu/opencloud/pkg/config/configlog"
pkgcrypto "github.com/opencloud-eu/opencloud/pkg/crypto"
@@ -91,7 +92,13 @@ func Server(cfg *config.Config) *cobra.Command {
gr.Add(runner.New(cfg.Service.Name+".svc", func() error {
return natsServer.ListenAndServe()
}, func() {
// INFO: this is a hotfix, we need to replace suture and wait for nats to
// gracefully shutdown using rungroups
// see https://github.com/opencloud-eu/opencloud/issues/2282
logger.Info().Msg("Gracefully shutting down the NATS server...")
natsServer.Shutdown()
time.Sleep(5 * time.Second) // wait for the server to shutdown gracefully
logger.Info().Msg("NATS server shutdown")
}))
grResults := gr.Run(ctx)