diff --git a/internal/http/dj_handlers.go b/internal/http/dj_handlers.go index d0e7a89..0667ef5 100644 --- a/internal/http/dj_handlers.go +++ b/internal/http/dj_handlers.go @@ -27,11 +27,7 @@ func (dj *DJHandlers) ListenersGet(w http.ResponseWriter, _ *http.Request) { func (dj *DJHandlers) ListenersInc(w http.ResponseWriter, _ *http.Request) { l := dj.listeners.Inc() - go func() { - if l > dj.songList.Current().MaxListeners { - dj.songList.Current().MaxListeners = l - } - }() + go dj.songList.UpdateCurrentMaxListeners(l) w.WriteHeader(http.StatusCreated) w.Header().Add("Content-Type", "text/plain") fmt.Fprint(w, l)