From 93ca0e436054c9f2e7ff98268976a017dc1da21a Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 8 May 2023 19:33:22 +0200 Subject: [PATCH] fix: endpoint update scheduler --- src/hp/magicsock/conn.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hp/magicsock/conn.rs b/src/hp/magicsock/conn.rs index 7b88062e21..6654f9f015 100644 --- a/src/hp/magicsock/conn.rs +++ b/src/hp/magicsock/conn.rs @@ -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); } @@ -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.