mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Log disk not found error just once (#6059)
Modified the LogIf function to log only if the error passed is not on the ignored errors list. Currently, only disk not found error is added to the list. Added a new function in logger package called LogAlwaysIf, which will print on any error. Fixes #5997
This commit is contained in:
committed by
Harshavardhana
parent
ff29aed05d
commit
0286e61aee
@@ -36,14 +36,14 @@ var printEndpointError = func() func(Endpoint, error) {
|
||||
m = make(map[string]bool)
|
||||
m[err.Error()] = true
|
||||
printOnce[endpoint] = m
|
||||
logger.LogIf(ctx, err)
|
||||
logger.LogAlwaysIf(ctx, err)
|
||||
return
|
||||
}
|
||||
if m[err.Error()] {
|
||||
return
|
||||
}
|
||||
m[err.Error()] = true
|
||||
logger.LogIf(ctx, err)
|
||||
logger.LogAlwaysIf(ctx, err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user