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) {
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user