mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
fix: calculate scanner metric paths for single drive (#15232)
Additionally use pathJoin() to avoid double `//` in path names.
This commit is contained in:
parent
af9bc7ea7d
commit
7b793d84c8
@ -166,7 +166,7 @@ func (p *scannerMetrics) currentPathUpdater(disk, initial string) (update func(p
|
|||||||
// getCurrentPaths returns the paths currently being processed.
|
// getCurrentPaths returns the paths currently being processed.
|
||||||
func (p *scannerMetrics) getCurrentPaths() []string {
|
func (p *scannerMetrics) getCurrentPaths() []string {
|
||||||
var res []string
|
var res []string
|
||||||
prefix := globalMinioAddr + "/"
|
prefix := globalLocalNodeName + "/"
|
||||||
p.currentPaths.Range(func(key, value interface{}) bool {
|
p.currentPaths.Range(func(key, value interface{}) bool {
|
||||||
// We are a bit paranoid, but better miss an entry than crash.
|
// We are a bit paranoid, but better miss an entry than crash.
|
||||||
name, ok := key.(string)
|
name, ok := key.(string)
|
||||||
@ -179,7 +179,7 @@ func (p *scannerMetrics) getCurrentPaths() []string {
|
|||||||
}
|
}
|
||||||
strptr := (*string)(atomic.LoadPointer(obj.name))
|
strptr := (*string)(atomic.LoadPointer(obj.name))
|
||||||
if strptr != nil {
|
if strptr != nil {
|
||||||
res = append(res, prefix+name+"/"+*strptr)
|
res = append(res, pathJoin(prefix, name, *strptr))
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user