mirror of
https://github.com/minio/minio.git
synced 2025-02-24 20:09:13 -05:00
avoid overwriting metrics on success, save it in defer (#17780)
This commit is contained in:
parent
0153f96a20
commit
21cdd2bf5d
@ -275,9 +275,11 @@ func (p *xlStorageDiskIDCheck) DiskInfo(ctx context.Context, metrics bool) (info
|
|||||||
si := p.updateStorageMetrics(storageMetricDiskInfo)
|
si := p.updateStorageMetrics(storageMetricDiskInfo)
|
||||||
defer si(&err)
|
defer si(&err)
|
||||||
|
|
||||||
if metrics {
|
defer func() {
|
||||||
info.Metrics = p.getMetrics()
|
if metrics {
|
||||||
}
|
info.Metrics = p.getMetrics()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if p.health.isFaulty() {
|
if p.health.isFaulty() {
|
||||||
// if disk is already faulty return faulty for 'mc admin info' output and prometheus alerts.
|
// if disk is already faulty return faulty for 'mc admin info' output and prometheus alerts.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user