diff --git a/cmd/dwelling-radio/main.go b/cmd/dwelling-radio/main.go index 7d8ac30..721f246 100644 --- a/cmd/dwelling-radio/main.go +++ b/cmd/dwelling-radio/main.go @@ -63,7 +63,7 @@ func main() { } lstnrs.RLock() - defer lstnrs.Unlock() + defer lstnrs.RUnlock() web.Index(¤tSong, lst, *songListLen, lstnrs, r).Render(context.Background(), w) }) diff --git a/internal/http/dj_handlers.go b/internal/http/dj_handlers.go index 9e1347d..e191fd1 100644 --- a/internal/http/dj_handlers.go +++ b/internal/http/dj_handlers.go @@ -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"`