From dd850f66bb6a9a6f292f2a117039f62530b2c325 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sun, 28 Jul 2019 08:03:55 +0200 Subject: [PATCH] lib/api: Close server before exiting serve (fixes #5866) (#5895) --- lib/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/api.go b/lib/api/api.go index 64efbf3e2..d52b7424a 100644 --- a/lib/api/api.go +++ b/lib/api/api.go @@ -79,7 +79,6 @@ type service struct { contr Controller noUpgrade bool tlsDefaultCommonName string - stop chan struct{} // signals intentional stop configChanged chan struct{} // signals intentional listener close due to config change started chan string // signals startup complete by sending the listener address, for testing only startedOnce chan struct{} // the service has started successfully at least once @@ -375,6 +374,7 @@ func (s *service) serve(stop chan struct{}) { // Restart due to listen/serve failure l.Warnln("GUI/API:", err, "(restarting)") } + srv.Close() } // Complete implements suture.IsCompletable, which signifies to the supervisor