Compare commits
No commits in common. "4fbd3c77175797f904da22a77814494d30c4c631" and "b0698e70a4336e4b7006e551b018b27bfada7931" have entirely different histories.
4fbd3c7717
...
b0698e70a4
@ -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();
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user