1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Run sync in a loop

This commit is contained in:
Roman Zeyde 2021-05-30 09:29:09 +03:00
parent 7a200480a4
commit cca0f270c2

View File

@ -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);
}
}