From 09841114257ac860421f16a8124849f06d2bc47f Mon Sep 17 00:00:00 2001 From: Mariusz Klochowicz Date: Thu, 25 Nov 2021 12:50:51 +1030 Subject: [PATCH] Increase heartbeat interval in debug builds When running in debug mode, the timeout was getting triggered during the contract setup phase. --- daemon/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index 8174ea4..d08ec17 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -52,7 +52,12 @@ pub mod wallet; pub mod wallet_sync; pub mod wire; -pub const HEARTBEAT_INTERVAL: std::time::Duration = Duration::from_secs(5); +// Certain operations (e.g. contract setup) take long time in debug mode, +// causing us to lag behind in processing heartbeats. +// Increasing the value for debug mode makes sure that we don't cause problems +// when testing / CI, whilst the release can still detect status faster +pub const HEARTBEAT_INTERVAL: std::time::Duration = + Duration::from_secs(if cfg!(debug_assertions) { 30 } else { 5 }); pub const N_PAYOUTS: usize = 200;