From cca0f270c2f47d6e3664a501745ee15df350f68d Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 30 May 2021 09:29:09 +0300 Subject: [PATCH] Run sync in a loop --- src/bin/sync.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/sync.rs b/src/bin/sync.rs index ef91958..318e354 100644 --- a/src/bin/sync.rs +++ b/src/bin/sync.rs @@ -5,5 +5,9 @@ use electrs::{Config, Daemon, Tracker}; fn main() -> Result<()> { let config = Config::from_args(); let daemon = Daemon::connect(&config)?; - Tracker::new(&config)?.sync(&daemon) + let mut tracker = Tracker::new(&config)?; + loop { + tracker.sync(&daemon)?; + std::thread::sleep(config.wait_duration); + } }