1
0

Add listen to Unix websocket (#484)

هذا الالتزام موجود في:
Thomas Miceli
2025-08-01 17:34:52 +02:00
ملتزم من قبل GitHub
الأصل b18cdb9188
التزام 979b302e4c
6 ملفات معدلة مع 190 إضافات و51 حذوفات

عرض الملف

@@ -36,11 +36,12 @@ var CmdStart = cli.Command{
Initialize(ctx)
go server.NewServer(os.Getenv("OG_DEV") == "1", path.Join(config.GetHomeDir(), "sessions"), false).Start()
server := server.NewServer(os.Getenv("OG_DEV") == "1", path.Join(config.GetHomeDir(), "sessions"), false)
go server.Start()
go ssh.Start()
<-stopCtx.Done()
shutdown()
shutdown(server)
return nil
},
}
@@ -130,7 +131,7 @@ func Initialize(ctx *cli.Context) {
}
}
func shutdown() {
func shutdown(server *server.Server) {
log.Info().Msg("Shutting down database...")
if err := db.Close(); err != nil {
log.Error().Err(err).Msg("Failed to close database")
@@ -141,6 +142,8 @@ func shutdown() {
index.Close()
}
server.Stop()
log.Info().Msg("Shutdown complete")
}