Skip to content

Commit

Permalink
removed noisy error checking in markAncestorsInCloud()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dabnsky committed Oct 19, 2023
1 parent 79668d7 commit 8a46c3e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions component/attr_cache/attr_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,12 @@ func (ac *AttrCache) markAncestorsInCloud(dirPath string, time time.Time) {
dirPath = internal.TruncateDirName(dirPath)
if len(dirPath) != 0 {
dirCacheItem, err := ac.cacheMap.get(dirPath)

// this insert is wiping children from this parent.the child path needs to come in here to resolve that
if !(err == nil && dirCacheItem.valid() && dirCacheItem.exists()) { //TODO: do more specific error check for attrCacheItem not existing
if err != nil || !dirCacheItem.exists() {
dirObjAttr := internal.CreateObjAttrDir(dirPath)
ac.cacheMap.insert(dirObjAttr, true, time)
}
dirCacheItem, err = ac.cacheMap.get(dirPath)
if err != nil { //TODO: do more specific error check for attrCacheItem not existing
log.Err("could not get the attribute item from cache due to the following error: ", err)
} else {
dirCacheItem.markInCloud(true)
dirCacheItem = ac.cacheMap.insert(dirObjAttr, true, time)
}

dirCacheItem.markInCloud(true)
// recurse
ac.markAncestorsInCloud(getParentDir(dirPath), time)
}
Expand Down

0 comments on commit 8a46c3e

Please sign in to comment.