mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
fix: atomic.Value should be a concrete type to avoid panics (#13740)
Go's atomic.Value does not support `nil` type, concrete type is necessary to avoid any panics with the current implementation. Also remove boolean to turn-off tracking of freezeCount.
This commit is contained in:
@@ -228,7 +228,7 @@ func (t *apiConfig) getRequestsPool() (chan struct{}, time.Duration) {
|
||||
func maxClients(f http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if val := globalServiceFreeze.Load(); val != nil {
|
||||
if unlock, ok := val.(chan struct{}); ok {
|
||||
if unlock, ok := val.(chan struct{}); ok && unlock != nil {
|
||||
// Wait until unfrozen.
|
||||
<-unlock
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user