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

Method updateOutputNode

common/nodes/path/handler-path-recycle.go:35–52  ·  view source on GitHub ↗

updateOutputNode adds "InsideRecycle" flag by scanning ancestors, if they are present in branch info

(ctx context.Context, node *tree.Node, identifier string)

Source from the content-addressed store, hash-verified

33
34// updateOutputNode adds "InsideRecycle" flag by scanning ancestors, if they are present in branch info
35func (r *RecyclePathHandler) updateOutputNode(ctx context.Context, node *tree.Node, identifier string) (context.Context, *tree.Node, error) {
36 // Just lookup in cache - do not trigger another load of ancestores
37 if branchInfo, be := nodes.GetBranchInfo(ctx, identifier); be == nil && branchInfo.AncestorsList != nil {
38 if ancestors, ok := branchInfo.AncestorsList[node.Path]; ok {
39 for _, p := range ancestors {
40 if p.GetUuid() == node.GetUuid() {
41 continue
42 }
43 if p.GetStringMeta(common.MetaNamespaceNodeName) == common.RecycleBinName {
44 out := node.Clone()
45 out.MustSetMeta(common.MetaNamespaceInsideRecycle, "true")
46 return ctx, out, nil
47 }
48 }
49 }
50 }
51 return ctx, node, nil
52}

Callers 1

Calls 5

GetBranchInfoFunction · 0.92
MustSetMetaMethod · 0.80
GetUuidMethod · 0.65
GetStringMetaMethod · 0.65
CloneMethod · 0.65

Tested by 1