diff --git a/base_layer/p2p/src/auto_update/service.rs b/base_layer/p2p/src/auto_update/service.rs index 8bed655a910..03c74f98038 100644 --- a/base_layer/p2p/src/auto_update/service.rs +++ b/base_layer/p2p/src/auto_update/service.rs @@ -20,7 +20,7 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::env::consts; +use std::{env::consts, time::Duration}; use futures::{future::Either, stream, StreamExt}; use log::*; @@ -93,7 +93,11 @@ impl SoftwareUpdaterService { notifier: watch::Sender>, new_update_notification: watch::Receiver>, ) { - let mut interval_or_never = match self.config.check_interval { + let mut config_interval = self.config.check_interval; + if Duration::from_secs(self.config.check_interval.unwrap_or_default().as_secs()).is_zero() { + config_interval = None; + } + let mut interval_or_never = match config_interval { Some(interval) => { let mut interval = time::interval(interval); interval.set_missed_tick_behavior(MissedTickBehavior::Skip);