diff --git a/pkg/arvo/ted/group/on-leave.hoon b/pkg/arvo/ted/group/on-leave.hoon index dfff1b179a..33088c8c8c 100644 --- a/pkg/arvo/ted/group/on-leave.hoon +++ b/pkg/arvo/ted/group/on-leave.hoon @@ -5,37 +5,6 @@ =* raw-poke raw-poke:strandio =* scry scry:strandio :: -=> -|% -++ remove-metadata - |= entries=(list [g=group-path:met m=md-resource:met]) - ^- form:m - |- ^- form:m - =* loop $ - ?~ entries - (pure:m !>(~)) - ;< ~ bind:m - %+ raw-poke - [our.bowl %metadata-store] - :- %metadata-action - !> ^- metadata-action:met - [%remove g.i.entries m.i.entries] - loop(entries t.entries) -:: -++ archive-graphs - |= graphs=(list path) - |- ^- form:m - =* loop $ - ?~ graphs - (pure:m !>(~)) - ;< ~ bind:m - %+ raw-poke - [our.bowl %graph-store] - :- %graph-update - !> ^- update:gra - [%0 now.bowl [%archive-graph (de-path:res i.graphs)]] - loop(graphs t.graphs) --- ^- thread:spider |= arg=vase =/ m (strand ,vase) @@ -44,6 +13,8 @@ ?. ?=(%remove-group -.update) (pure:m !>(~)) ;< =bowl:spider bind:m get-bowl:strandio +:: stop serving or syncing metadata associated with group +:: ;< ~ bind:m %+ raw-poke [our.bowl %metadata-hook] @@ -51,7 +22,7 @@ !> ^- metadata-hook-action:hook [%remove (en-path:res resource.update)] :: -:: get metadata associated with group and remove it +:: get metadata associated with group ;< =associations:met bind:m %+ scry associations:met ;: weld @@ -59,11 +30,26 @@ (en-path:res resource.update) /noun == +=/ entries=(list [g=group-path:met m=md-resource:met]) + ~(tap in ~(key by associations)) +|- ^- form:m +=* loop $ +?~ entries + (pure:m !>(~)) +:: remove metadata associated with group +:: ;< ~ bind:m - (remove-metadata ~(tap in ~(key by associations))) -=/ graphs=(list path) - %+ turn ~(tap in ~(key by associations)) - |= [g=group-path:met m=md-resource:met] - ^- path - app-path.m -(archive-graphs graphs) + %+ raw-poke + [our.bowl %metadata-store] + :- %metadata-action + !> ^- metadata-action:met + [%remove g.i.entries m.i.entries] +:: archive graph associated with group +:: +;< ~ bind:m + %+ raw-poke + [our.bowl %graph-store] + :- %graph-update + !> ^- update:gra + [%0 now.bowl [%archive-graph (de-path:res app-path.m.i.entries)]] +loop(entries t.entries)