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()
|
statusMutex.RLock()
|
||||||
defer statusMutex.RUnlock()
|
defer statusMutex.RUnlock()
|
||||||
|
|
||||||
_, blockers := getBlockers()
|
_, blockers := getBlockersNoLock()
|
||||||
|
|
||||||
response := StatusResponse{
|
response := StatusResponse{
|
||||||
Usage: currentStatus,
|
Usage: currentStatus,
|
||||||
@ -194,7 +194,10 @@ func handleReset(w http.ResponseWriter, _ *http.Request) {
|
|||||||
func getBlockers() (bool, []string) {
|
func getBlockers() (bool, []string) {
|
||||||
statusMutex.Lock()
|
statusMutex.Lock()
|
||||||
defer statusMutex.Unlock()
|
defer statusMutex.Unlock()
|
||||||
|
return getBlockersNoLock()
|
||||||
|
}
|
||||||
|
|
||||||
|
func getBlockersNoLock() (bool, []string) {
|
||||||
blocked := true
|
blocked := true
|
||||||
blockers := []string{}
|
blockers := []string{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user