From 852390a354bdedc3fc6bd6d8571ab8caa1d39b44 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Wed, 9 Apr 2025 10:37:17 +0200 Subject: [PATCH] Fix locking issue --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ccbcfe7..92e298c 100644 --- a/main.go +++ b/main.go @@ -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{}