From 4fb74a32ccb2772a8a89572f12e9693e941de3a4 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 20 Apr 2015 12:34:04 +0900 Subject: [PATCH] Don't initialize subscription in init() By doing it init(), the monitor process also gets a subscription thing running, which is unnecessary (and really confused me when seeing it in the debug output). --- cmd/syncthing/gui.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index bfe7bbe60..a6e0e956a 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -57,14 +57,12 @@ var ( lastEventRequestMut sync.Mutex ) -func init() { +func startGUI(cfg config.GUIConfiguration, assetDir string, m *model.Model) error { + var err error + l.AddHandler(logger.LevelWarn, showGuiError) sub := events.Default.Subscribe(events.AllEvents) eventSub = events.NewBufferedSubscription(sub, 1000) -} - -func startGUI(cfg config.GUIConfiguration, assetDir string, m *model.Model) error { - var err error cert, err := tls.LoadX509KeyPair(locations[locHTTPSCertFile], locations[locHTTPSKeyFile]) if err != nil {