In DJHandlers.ListenersInc() a code for updating max listeners was replaced by a function call to UpdateCurrentMaxListeners().
This commit is contained in:
parent
eeadbc4f96
commit
f1eaba016f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user