From fc2b5fe4823a49b2b07b3be36deed26d6442f520 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 18 Oct 2021 10:35:18 +1100 Subject: [PATCH] Sync with Olivia every 5 seconds We are only making requests to Olivia that are absolutely necessary, i.e. only fetch attestations when they are likely ready and only fetch attestations that we definitely need. As a result, we can trigger the sync much more frequent. Fixes #349. --- daemon/src/maker.rs | 2 +- daemon/src/taker.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/src/maker.rs b/daemon/src/maker.rs index 9ebbb7c..c5bf8d2 100644 --- a/daemon/src/maker.rs +++ b/daemon/src/maker.rs @@ -257,7 +257,7 @@ async fn main() -> Result<()> { tokio::spawn( oracle_actor_context - .notify_interval(Duration::from_secs(60), || oracle::Sync) + .notify_interval(Duration::from_secs(5), || oracle::Sync) .unwrap(), ); let actor = fan_out::Actor::new(&[&cfd_maker_actor_inbox, &monitor_actor_address]) diff --git a/daemon/src/taker.rs b/daemon/src/taker.rs index 967dc79..bc2acef 100644 --- a/daemon/src/taker.rs +++ b/daemon/src/taker.rs @@ -251,7 +251,7 @@ async fn main() -> Result<()> { tokio::spawn(wallet_sync::new(wallet, wallet_feed_sender)); tokio::spawn( oracle_actor_context - .notify_interval(Duration::from_secs(60), || oracle::Sync) + .notify_interval(Duration::from_secs(5), || oracle::Sync) .unwrap(), ); let actor = fan_out::Actor::new(&[&cfd_actor_inbox, &monitor_actor_address])