From 0fc1f300f8a36d0ee3f31d7c4253555553d6d840 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 18 Aug 2020 21:43:39 -0700 Subject: [PATCH] Use helper func --- server/listeners.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/listeners.go b/server/listeners.go index 3f89e92..dd5e541 100644 --- a/server/listeners.go +++ b/server/listeners.go @@ -50,10 +50,8 @@ func (s *Server) StartEventListeners() { // cause it to block until the first call is done calculating disk usage, which will // case stat events to pile up for the server. s.Filesystem.HasSpaceAvailable() - - // Emit the event to the websocket. - b, _ := json.Marshal(s.Proc()) - s.Events().Publish(StatsEvent, string(b)) + + s.emitProcUsage() } } }()