From dc359589184e083878c1e78b39cde6c54982f632 Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 4 Nov 2019 18:57:17 +0100 Subject: [PATCH] eth-watcher: refactor refresh rate to top of file --- pkg/arvo/app/eth-watcher.hoon | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/app/eth-watcher.hoon b/pkg/arvo/app/eth-watcher.hoon index 567ee18b4..e9afc4158 100644 --- a/pkg/arvo/app/eth-watcher.hoon +++ b/pkg/arvo/app/eth-watcher.hoon @@ -4,6 +4,11 @@ /+ tapp, stdio, ethio =, ethereum-types =, able:jael +:: +=> |% + ++ refresh-rate ~m5 + -- +:: => |% +$ app-state $: %0 @@ -295,7 +300,7 @@ ^- form:m :: start update timer loop ;< now=@da bind:m get-time:stdio - ;< ~ bind:m (wait-effect:stdio (add now ~m5)) + ;< ~ bind:m (wait-effect:stdio (add now refresh-rate)) (pure:m state) :: ++ handle-diff handle-diff:default-tapp @@ -336,7 +341,7 @@ %wake ;< ~ bind:m ;< now=@da bind:(async:tapp ,~) get-time:stdio - =/ next=@da (add now ~m5) + =/ next=@da (add now refresh-rate) ::NOTE we use +send-raw-card here to ensure we always set a new timer, :: regardless of what happens further on in the flow. (send-raw-card:stdio %wait /effect/(scot %da next) next)