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