MoveNodeTree move all the nodes belonging to a tree by calculating the new mpathes
(ctx context.Context, nodeFrom tree.ITreeNode, nodeTo tree.ITreeNode)
| 186 | |
| 187 | // MoveNodeTree move all the nodes belonging to a tree by calculating the new mpathes |
| 188 | func (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 | |
| 197 | func (dao *FolderSizeCacheSQL) invalidateMPathHierarchy(ctx context.Context, mpath *tree.MPath, level int) { |
| 198 | ca, err := cache_helper.ResolveCache(ctx, common.CacheTypeShared, folderSizeCacheConfig) |
nothing calls this directly
no test coverage detected