1
0

Need to use RUnlock for RLock.

This commit is contained in:
Alexander Andreev 2024-06-18 19:50:56 +04:00
parent 88ecf675b6
commit b8f6163cb8
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ func main() {
}
lstnrs.RLock()
defer lstnrs.Unlock()
defer lstnrs.RUnlock()
web.Index(&currentSong, lst, *songListLen, lstnrs, r).Render(context.Background(), w)
})

View File

@ -140,7 +140,7 @@ func (dj *DJHandlers) Status(w http.ResponseWriter, r *http.Request) {
}
dj.listeners.RLock()
defer dj.listeners.Unlock()
defer dj.listeners.RUnlock()
err = json.NewEncoder(w).Encode(&struct {
Current *radio.Song `json:"current_song,omitempty"`
Listeners int64 `json:"listeners"`