mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +08:00
Unlock mutex before returning error in handlers.go to prevent deadlocks
This commit is contained in:
@@ -109,6 +109,7 @@ func (h *BaseAPIHandler) GetClient(modelName string, isGenerateContent ...bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(clients) == 0 {
|
if len(clients) == 0 {
|
||||||
|
h.Mutex.Unlock()
|
||||||
return nil, &interfaces.ErrorMessage{StatusCode: 500, Error: fmt.Errorf("no clients available")}
|
return nil, &interfaces.ErrorMessage{StatusCode: 500, Error: fmt.Errorf("no clients available")}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user