don't immediately run fetcher a second time on startup
This commit is contained in:
parent
1f7e5ee5ca
commit
774f3195de
|
@ -50,10 +50,10 @@ async fn start_updater() -> Result<web::Data<AppState>, Error> {
|
|||
std::thread::spawn(move || {
|
||||
actix_web::rt::System::new().block_on(async {
|
||||
loop {
|
||||
actix_web::rt::time::sleep(*UPDATE_INTERVAL).await;
|
||||
if let Err(e) = try_update(&state_copy, &mut fetcher).await {
|
||||
eprintln!("Error updating data: {:#?}", e);
|
||||
}
|
||||
actix_web::rt::time::sleep(*UPDATE_INTERVAL).await;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue