mirror of
https://github.com/pgsty/minio.git
synced 2026-07-22 13:40:22 +03:00
avoid overwriting metrics on success, save it in defer (#17780)
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user