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).
This commit is contained in:
Jakob Borg 2015-04-20 12:34:04 +09:00
parent c741465328
commit 4fb74a32cc

View File

@ -57,14 +57,12 @@ var (
lastEventRequestMut sync.Mutex lastEventRequestMut sync.Mutex
) )
func init() { func startGUI(cfg config.GUIConfiguration, assetDir string, m *model.Model) error {
var err error
l.AddHandler(logger.LevelWarn, showGuiError) l.AddHandler(logger.LevelWarn, showGuiError)
sub := events.Default.Subscribe(events.AllEvents) sub := events.Default.Subscribe(events.AllEvents)
eventSub = events.NewBufferedSubscription(sub, 1000) 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]) cert, err := tls.LoadX509KeyPair(locations[locHTTPSCertFile], locations[locHTTPSKeyFile])
if err != nil { if err != nil {