Fix locking issue

This commit is contained in:
Sebastiaan de Schaetzen 2025-04-09 10:37:17 +02:00
parent 37d76f34da
commit 852390a354

View File

@ -166,7 +166,7 @@ func handleStatus(w http.ResponseWriter, _ *http.Request) {
statusMutex.RLock()
defer statusMutex.RUnlock()
_, blockers := getBlockers()
_, blockers := getBlockersNoLock()
response := StatusResponse{
Usage: currentStatus,
@ -194,7 +194,10 @@ func handleReset(w http.ResponseWriter, _ *http.Request) {
func getBlockers() (bool, []string) {
statusMutex.Lock()
defer statusMutex.Unlock()
return getBlockersNoLock()
}
func getBlockersNoLock() (bool, []string) {
blocked := true
blockers := []string{}