Skip to content

Commit

Permalink
Fixup: do not call Tick::shutdown if it is already shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Feb 18, 2024
1 parent 14a591e commit 23553ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openraft/src/core/tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ where C: RaftTypeConfig
{
/// Signal the tick loop to stop, without waiting for it to stop.
fn drop(&mut self) {
if self.shutdown.lock().unwrap().is_none() {
return;
}
let _ = self.shutdown();
}
}
Expand Down

0 comments on commit 23553ba

Please sign in to comment.