Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions engine/packages/datacenter/src/workflows/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ async fn record_ping(
) -> Result<()> {
let peer_url = dc.peer_url.join("/health")?;
let start = Instant::now();
let now = util::timestamp::now();

let peer_res = client
.get(peer_url)
Expand All @@ -88,10 +89,7 @@ async fn record_ping(
.run(|tx| async move {
let tx = tx.with_subspace(keys::subspace());

tx.write(
&keys::LastPingTsKey::new(dc.datacenter_label),
util::timestamp::now(),
)?;
tx.write(&keys::LastPingTsKey::new(dc.datacenter_label), now)?;
tx.write(&keys::LastRttKey::new(dc.datacenter_label), rtt)?;

Ok(())
Expand Down
9 changes: 1 addition & 8 deletions engine/packages/pegboard-runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,7 @@ impl CustomServeTrait for PegboardRunnerWsCustomServe {
));

// Update pings
let update_ping_interval =
Duration::from_millis(ctx.config().pegboard().runner_update_ping_interval_ms());
let ping = tokio::spawn(ping_task::task(
ctx.clone(),
conn.clone(),
ping_abort_rx,
update_ping_interval,
));
let ping = tokio::spawn(ping_task::task(ctx.clone(), conn.clone(), ping_abort_rx));
let tunnel_to_ws_abort_tx2 = tunnel_to_ws_abort_tx.clone();
let ws_to_tunnel_abort_tx2 = ws_to_tunnel_abort_tx.clone();
let ping_abort_tx2 = ping_abort_tx.clone();
Expand Down
3 changes: 2 additions & 1 deletion engine/packages/pegboard-runner/src/ping_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ pub async fn task(
ctx: StandaloneCtx,
conn: Arc<Conn>,
mut ping_abort_rx: watch::Receiver<()>,
update_ping_interval: Duration,
) -> Result<LifecycleResult> {
let update_ping_interval =
Duration::from_millis(ctx.config().pegboard().runner_update_ping_interval_ms());
let ping_timeout_ms = ctx.config().pegboard().runner_ping_timeout_ms();

loop {
Expand Down
Loading