Skip to content

Commit

Permalink
address code review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog authored and cdunster committed Oct 23, 2024
1 parent 3f6fee5 commit c1c12dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions scenarios/remote_signals/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,25 @@ fn agent_behaviour(
.execute_in_place(async move {
let now = Timestamp::now();

let mut timeout_count = 0;

pending_set.lock().unwrap().retain(|msg| {
if now.as_millis() - msg.requested_at().as_millis()
> response_timeout.as_millis() as i64
{
reporter.add_custom(
ReportMetric::new("remote_signal_timeout").with_field("value", 1),
);
timeout_count += 1;
false
} else {
true
}
});

while timeout_count > 0 {
reporter
.add_custom(ReportMetric::new("remote_signal_timeout").with_field("value", 1));
timeout_count -= 1;
}

match next_remote_signal_peer {
None => {
// No more agents available to signal, get a new list.
Expand Down
2 changes: 1 addition & 1 deletion zomes/remote_signal/coordinator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "remote_signals"
name = "remote_signal"
version = "0.1.0"
edition = "2021"
description = "A Holochain coordinator zome for remote signals"
Expand Down

0 comments on commit c1c12dc

Please sign in to comment.