Unlock mutex before returning error in handlers.go to prevent deadlocks

This commit is contained in:
Luis Pater
2025-08-29 09:46:12 +08:00
parent e9e0016a63
commit 09b9d3b3fa

View File

@@ -109,6 +109,7 @@ func (h *BaseAPIHandler) GetClient(modelName string, isGenerateContent ...bool)
}
if len(clients) == 0 {
h.Mutex.Unlock()
return nil, &interfaces.ErrorMessage{StatusCode: 500, Error: fmt.Errorf("no clients available")}
}