This commit is contained in:
2025-11-30 10:11:46 +02:00
parent 44e92bcfef
commit 96f67941ce

View File

@@ -228,11 +228,6 @@ func (ls *LiveServer) Start(addr string) error {
func (ls *LiveServer) stop(inst *instance) error {
slog.Debug("stopping server")
instAny := ls.active.Load()
if instAny == nil {
return nil
}
inst.ln.Close()
err := inst.srv.Shutdown(context.Background())
if err != nil {
@@ -247,7 +242,11 @@ func (ls *LiveServer) stop(inst *instance) error {
}
func (ls *LiveServer) Stop() error {
return ls.stop(ls.active.Load().(*instance))
inst := ls.active.Load().(*instance)
if inst == nil {
return nil
}
return ls.stop(inst)
}