MCPcopy Create free account
hub / github.com/pydio/cells / MoveNodeTree

Method MoveNodeTree

common/storage/sql/index/folder-size-cache.go:188–195  ·  view source on GitHub ↗

MoveNodeTree move all the nodes belonging to a tree by calculating the new mpathes

(ctx context.Context, nodeFrom tree.ITreeNode, nodeTo tree.ITreeNode)

Source from the content-addressed store, hash-verified

186
187// MoveNodeTree move all the nodes belonging to a tree by calculating the new mpathes
188func (dao *FolderSizeCacheSQL) MoveNodeTree(ctx context.Context, nodeFrom tree.ITreeNode, nodeTo tree.ITreeNode) error {
189 root := nodeTo.GetMPath().CommonRoot(nodeFrom.GetMPath())
190
191 dao.invalidateMPathHierarchy(ctx, nodeTo.GetMPath(), root.Length())
192 dao.invalidateMPathHierarchy(ctx, nodeFrom.GetMPath(), root.Length())
193
194 return dao.DAO.MoveNodeTree(ctx, nodeFrom, nodeTo)
195}
196
197func (dao *FolderSizeCacheSQL) invalidateMPathHierarchy(ctx context.Context, mpath *tree.MPath, level int) {
198 ca, err := cache_helper.ResolveCache(ctx, common.CacheTypeShared, folderSizeCacheConfig)

Callers

nothing calls this directly

Calls 5

CommonRootMethod · 0.80
LengthMethod · 0.80
GetMPathMethod · 0.65
MoveNodeTreeMethod · 0.65

Tested by

no test coverage detected