1
0

In DJHandlers.ListenersInc() a code for updating max listeners was replaced by a function call to UpdateCurrentMaxListeners().

This commit is contained in:
Alexander Andreev 2023-10-05 18:05:27 +04:00
parent eeadbc4f96
commit f1eaba016f
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

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