Skip to content

Commit

Permalink
fix(base_node_config): check_interval is 0 made base node is panicked
Browse files Browse the repository at this point in the history
  • Loading branch information
hnidoaht-101 committed Aug 18, 2022
1 parent 37d38d6 commit a44933a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions base_layer/p2p/src/auto_update/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ impl SoftwareUpdaterService {
) {
let mut interval_or_never = match self.config.check_interval {
Some(interval) => {
let mut interval = time::interval(interval);
interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
Either::Left(wrappers::IntervalStream::new(interval))
if interval.is_zero() {
Either::Right(stream::empty())
} else {
let mut interval = time::interval(interval);
interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
Either::Left(wrappers::IntervalStream::new(interval))
}
},
None => Either::Right(stream::empty()),
};
Expand Down

0 comments on commit a44933a

Please sign in to comment.