|
@ -4,6 +4,7 @@ import ( |
|
|
"context" |
|
|
"context" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"os" |
|
|
"os" |
|
|
|
|
|
"strings" |
|
|
"sync" |
|
|
"sync" |
|
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/filer" |
|
|
"github.com/chrislusf/seaweedfs/weed/filer" |
|
@ -29,7 +30,12 @@ func NewMetaCache(dbFolder string, baseDir util.FullPath, uidGidMapper *UidGidMa |
|
|
localStore: openMetaStore(dbFolder), |
|
|
localStore: openMetaStore(dbFolder), |
|
|
visitedBoundary: bounded_tree.NewBoundedTree(baseDir), |
|
|
visitedBoundary: bounded_tree.NewBoundedTree(baseDir), |
|
|
uidGidMapper: uidGidMapper, |
|
|
uidGidMapper: uidGidMapper, |
|
|
invalidateFunc: invalidateFunc, |
|
|
|
|
|
|
|
|
invalidateFunc: func(fullpath util.FullPath) { |
|
|
|
|
|
if baseDir != "/" && strings.HasPrefix(string(fullpath), string(baseDir)) { |
|
|
|
|
|
fullpath = fullpath[len(baseDir):] |
|
|
|
|
|
} |
|
|
|
|
|
invalidateFunc(fullpath) |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|