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) {
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)