Compare commits

..

No commits in common. "4fbd3c77175797f904da22a77814494d30c4c631" and "b0698e70a4336e4b7006e551b018b27bfada7931" have entirely different histories.

View File

@ -14,12 +14,8 @@ pub fn schedule(db: &SqlitePool, config: &Config) {
let openweathermap_key = config.openweathermap_key.clone(); let openweathermap_key = config.openweathermap_key.clone();
tokio::task::spawn(async { tokio::task::spawn(async {
if let Err(e) = waterlevel::update(&db).await { waterlevel::update(&db).await.unwrap();
log::error!("Water level update error: {e}, trying again next time"); weather::update(&db, &openweathermap_key).await.unwrap();
}
if let Err(e) = weather::update(&db, &openweathermap_key).await {
log::error!("Weather update error: {e}, trying again next time");
}
let mut sched = JobScheduler::new(); let mut sched = JobScheduler::new();
@ -30,12 +26,10 @@ pub fn schedule(db: &SqlitePool, config: &Config) {
// nicer one's rust (stable) support async closures // nicer one's rust (stable) support async closures
task::block_in_place(|| { task::block_in_place(|| {
tokio::runtime::Handle::current().block_on(async { tokio::runtime::Handle::current().block_on(async {
if let Err(e) = waterlevel::update(&db_clone).await { waterlevel::update(&db_clone).await.unwrap();
log::error!("Water level update error: {e}, trying again next time"); weather::update(&db_clone, &openweathermap_key)
} .await
if let Err(e) = weather::update(&db_clone, &openweathermap_key).await { .unwrap();
log::error!("Weather update error: {e}, trying again next time");
}
}); });
}); });
})); }));