Skip to content

Commit

Permalink
fix: endpoint update scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed May 8, 2023
1 parent 027f501 commit 93ca0e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hp/magicsock/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,11 @@ impl Actor {
self.periodic_re_stun_timer = new_re_stun_timer();
}

self.endpoints_update_state
.running
.send(None)
.expect("sender not go away");

debug!("endpoint update done ({})", why);
}

Expand Down Expand Up @@ -2789,7 +2794,7 @@ fn new_re_stun_timer() -> time::Interval {
let mut rng = rand::thread_rng();
let d: Duration = rng.gen_range(Duration::from_secs(20)..=Duration::from_secs(26));
debug!("scheduling periodic_stun to run in {}s", d.as_secs());
time::interval(d)
time::interval_at(time::Instant::now() + d, d)
}

/// Initial connection setup.
Expand Down

0 comments on commit 93ca0e4

Please sign in to comment.