Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/garden/app/hark-store.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,12 @@
(~(put by half-open) bin now.bowl)
=/ existing (get-lid archive/time bin)
=/ new (merge-notification existing note)
=? half-open (lth 30 (lent body.new))
(~(del by half-open) bin)
=. poke-core
(put-lid archive/time bin new)
=. poke-core (del-lid lid bin)
=. poke-core (give %archived now.bowl unseen+~ (~(got re archive) time bin))
=. poke-core (give %archived now.bowl seen+~ (~(got re archive) time bin))
=. poke-core (give %archived time lid (~(got re archive) time bin))
$(bins t.bins)
::
++ read-count
Expand Down
15 changes: 14 additions & 1 deletion pkg/garden/tests/app/hark-store.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[%read-count place]
::
+$ state
$: %8
$: %9
places=(map place:hark stats:hark)
seen=timebox:hark
unseen=timebox:hark
Expand Down Expand Up @@ -87,4 +87,17 @@
=/ actual-archive=notification:hark
(~(got re archive.state) (add *time ~s1) bin)
(expect-eq !>(expected-archive) !>(actual-archive))
::
++ test-half-open-capped
=| run=@ud
|-
?: =(run 31)
=+ !<(=state on-save:agent)
(expect-eq !>(~) !>(half-open.state))
=^ movs agent
(~(on-poke agent (bowl run)) %hark-action !>((add-note run)))
=^ mavs agent
(~(on-poke agent (bowl run)) %hark-action !>(read-count))
$(run +(run))
::
--