mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 13:04:17 +03:00
%group-on-leave thread: simplified and got it to compile
This commit is contained in:
parent
2a47b18be7
commit
46fd3004bf
@ -5,37 +5,6 @@
|
|||||||
=* raw-poke raw-poke:strandio
|
=* raw-poke raw-poke:strandio
|
||||||
=* scry scry: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
|
^- thread:spider
|
||||||
|= arg=vase
|
|= arg=vase
|
||||||
=/ m (strand ,vase)
|
=/ m (strand ,vase)
|
||||||
@ -44,6 +13,8 @@
|
|||||||
?. ?=(%remove-group -.update)
|
?. ?=(%remove-group -.update)
|
||||||
(pure:m !>(~))
|
(pure:m !>(~))
|
||||||
;< =bowl:spider bind:m get-bowl:strandio
|
;< =bowl:spider bind:m get-bowl:strandio
|
||||||
|
:: stop serving or syncing metadata associated with group
|
||||||
|
::
|
||||||
;< ~ bind:m
|
;< ~ bind:m
|
||||||
%+ raw-poke
|
%+ raw-poke
|
||||||
[our.bowl %metadata-hook]
|
[our.bowl %metadata-hook]
|
||||||
@ -51,7 +22,7 @@
|
|||||||
!> ^- metadata-hook-action:hook
|
!> ^- metadata-hook-action:hook
|
||||||
[%remove (en-path:res resource.update)]
|
[%remove (en-path:res resource.update)]
|
||||||
::
|
::
|
||||||
:: get metadata associated with group and remove it
|
:: get metadata associated with group
|
||||||
;< =associations:met bind:m
|
;< =associations:met bind:m
|
||||||
%+ scry associations:met
|
%+ scry associations:met
|
||||||
;: weld
|
;: weld
|
||||||
@ -59,11 +30,26 @@
|
|||||||
(en-path:res resource.update)
|
(en-path:res resource.update)
|
||||||
/noun
|
/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
|
;< ~ bind:m
|
||||||
(remove-metadata ~(tap in ~(key by associations)))
|
%+ raw-poke
|
||||||
=/ graphs=(list path)
|
[our.bowl %metadata-store]
|
||||||
%+ turn ~(tap in ~(key by associations))
|
:- %metadata-action
|
||||||
|= [g=group-path:met m=md-resource:met]
|
!> ^- metadata-action:met
|
||||||
^- path
|
[%remove g.i.entries m.i.entries]
|
||||||
app-path.m
|
:: archive graph associated with group
|
||||||
(archive-graphs graphs)
|
::
|
||||||
|
;< ~ 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user