crawler: Missing folder heal check per set (#10876)

This commit is contained in:
Klaus Post
2020-12-01 12:07:39 -08:00
committed by GitHub
parent 790833f3b2
commit e6ea5c2703
8 changed files with 487 additions and 159 deletions

View File

@@ -246,6 +246,19 @@ func (m metaCacheEntries) resolve(r *metadataResolutionParams) (selected *metaCa
return selected, selected != nil
}
// firstFound returns the first found and the number of set entries.
func (m metaCacheEntries) firstFound() (first *metaCacheEntry, n int) {
for _, entry := range m {
if entry.name != "" {
n++
if first == nil {
first = &entry
}
}
}
return first, n
}
// names will return all names in order.
// Since this allocates it should not be used in critical functions.
func (m metaCacheEntries) names() []string {