Need to use RUnlock for RLock.
This commit is contained in:
parent
88ecf675b6
commit
b8f6163cb8
@ -63,7 +63,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lstnrs.RLock()
|
lstnrs.RLock()
|
||||||
defer lstnrs.Unlock()
|
defer lstnrs.RUnlock()
|
||||||
web.Index(¤tSong, lst, *songListLen, lstnrs, r).Render(context.Background(), w)
|
web.Index(¤tSong, lst, *songListLen, lstnrs, r).Render(context.Background(), w)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ func (dj *DJHandlers) Status(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dj.listeners.RLock()
|
dj.listeners.RLock()
|
||||||
defer dj.listeners.Unlock()
|
defer dj.listeners.RUnlock()
|
||||||
err = json.NewEncoder(w).Encode(&struct {
|
err = json.NewEncoder(w).Encode(&struct {
|
||||||
Current *radio.Song `json:"current_song,omitempty"`
|
Current *radio.Song `json:"current_song,omitempty"`
|
||||||
Listeners int64 `json:"listeners"`
|
Listeners int64 `json:"listeners"`
|
||||||
|
Loading…
Reference in New Issue
Block a user