Fix locking issue
This commit is contained in:
parent
37d76f34da
commit
852390a354
5
main.go
5
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{}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user