Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
Merge #2029
Browse files Browse the repository at this point in the history
2029: Heartbeat fixes questionmark r=da-kami a=da-kami



Co-authored-by: Daniel Karzel <[email protected]>
  • Loading branch information
bors[bot] and da-kami authored May 13, 2022
2 parents 68a1c2d + 158bf39 commit e3d6f34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion daemon/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Actor {
heartbeat_measuring_rate: maker_heartbeat_interval.checked_div(2).expect("to divide"),
maker_heartbeat_interval,
heartbeat_timeout: maker_heartbeat_interval
.checked_mul(2)
.checked_mul(36)
.expect("to not overflow"),
state: State::Disconnected,
setup_actors: AddressMap::default(),
Expand Down
7 changes: 1 addition & 6 deletions daemon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,14 @@ where
.create(None)
.spawn(&mut tasks);

// Timeout happens when taker did not receive two consecutive heartbeats
let taker_heartbeat_timeout = maker_heartbeat_interval
.checked_mul(2)
.expect("not to overflow");

tasks.add(
connection_actor_ctx
.with_handler_timeout(Duration::from_secs(120))
.run(connection::Actor::new(
maker_online_status_feed_sender,
&cfd_actor_addr,
identity.identity_sk,
taker_heartbeat_timeout,
maker_heartbeat_interval,
connect_timeout,
)),
);
Expand Down

0 comments on commit e3d6f34

Please sign in to comment.