mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 08:32:39 +03:00
Merge pull request #4533 from urbit/m/safer-tally
tally: be safer wrt mangled metadata
This commit is contained in:
commit
5a6a88c4db
@ -61,14 +61,24 @@
|
|||||||
::NOTE we only count graphs for now
|
::NOTE we only count graphs for now
|
||||||
?. &(=(%graph app-name.m) =(our creator.metadatum)) ~
|
?. &(=(%graph app-name.m) =(our creator.metadatum)) ~
|
||||||
`[module.metadatum resource.m]
|
`[module.metadatum resource.m]
|
||||||
|
:: for sanity checks
|
||||||
|
::
|
||||||
|
=/ real=(set resource:re)
|
||||||
|
=/ upd=update:ga
|
||||||
|
%+ scry update:ga
|
||||||
|
[%x %graph-store /keys/graph-update]
|
||||||
|
?> ?=(%keys -.q.upd)
|
||||||
|
resources.q.upd
|
||||||
:: count activity per channel
|
:: count activity per channel
|
||||||
::
|
::
|
||||||
=/ activity=(list [resource:re members=@ud (list [resource:re mod=term week=@ud authors=@ud])])
|
=/ activity=(list [resource:re members=@ud (list [resource:re mod=term week=@ud authors=@ud])])
|
||||||
%+ turn crowds
|
%+ turn crowds
|
||||||
|= [g=resource:re m=@ud]
|
|= [g=resource:re m=@ud]
|
||||||
:+ g m
|
:+ g m
|
||||||
%+ turn (~(got by channels) g)
|
%+ murn (~(got by channels) g)
|
||||||
|= [m=term r=resource:re]
|
|= [m=term r=resource:re]
|
||||||
|
?. (~(has in real) r) ~
|
||||||
|
%- some
|
||||||
:+ r m
|
:+ r m
|
||||||
::NOTE graph-store doesn't use the full resource-style path here!
|
::NOTE graph-store doesn't use the full resource-style path here!
|
||||||
=/ upd=update:ga
|
=/ upd=update:ga
|
||||||
|
Loading…
Reference in New Issue
Block a user