Skip to content

Commit

Permalink
[sa] Move retry interval outside loop (#5276)
Browse files Browse the repository at this point in the history
Fixes #5275
  • Loading branch information
andrewjstone authored Mar 16, 2024
1 parent f63707a commit 255b14a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sled-agent/src/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,11 @@ impl NexusNotifierTask {
(Some(tx), rx)
};

const RETRY_TIMEOUT: Duration = Duration::from_secs(2);
let mut interval = interval(RETRY_TIMEOUT);
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);

loop {
const RETRY_TIMEOUT: Duration = Duration::from_secs(2);
let mut interval = interval(RETRY_TIMEOUT);
interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
tokio::select! {
req = self.rx.recv() => {
let Some(req) = req else {
Expand Down

0 comments on commit 255b14a

Please sign in to comment.