Skip to content

Commit

Permalink
refined addDirsNotInCloudToListing() from https://github.com/Seagate/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dabnsky committed Oct 19, 2023
1 parent 1888592 commit 5dcc8c6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions component/attr_cache/attr_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,12 @@ func (ac *AttrCache) addDirsNotInCloudToListing(listPath string, pathList []*int
return nil, 0
}

if nonCloudItem.valid() && nonCloudItem.exists() && nonCloudItem.attr.IsDir() && !nonCloudItem.isInCloud() {
if nonCloudItem.exists() {
ac.cacheLock.RLock()
if nonCloudItem.children != nil {
for _, item := range nonCloudItem.children {
if !item.attr.IsDir() {
pathList = append(pathList, item.attr)
numAdded++
}
for _, chldNonCloudItem := range nonCloudItem.children {
if chldNonCloudItem.exists() && !chldNonCloudItem.isInCloud() {
pathList = append(pathList, chldNonCloudItem.attr)
numAdded++
}
}
ac.cacheLock.RUnlock()
Expand Down

0 comments on commit 5dcc8c6

Please sign in to comment.