stop fix
This commit is contained in:
@@ -228,11 +228,6 @@ func (ls *LiveServer) Start(addr string) error {
|
|||||||
func (ls *LiveServer) stop(inst *instance) error {
|
func (ls *LiveServer) stop(inst *instance) error {
|
||||||
slog.Debug("stopping server")
|
slog.Debug("stopping server")
|
||||||
|
|
||||||
instAny := ls.active.Load()
|
|
||||||
if instAny == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
inst.ln.Close()
|
inst.ln.Close()
|
||||||
err := inst.srv.Shutdown(context.Background())
|
err := inst.srv.Shutdown(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -247,7 +242,11 @@ func (ls *LiveServer) stop(inst *instance) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ls *LiveServer) Stop() 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user