Compare commits
No commits in common. "6b24008c1724580fca5f98062ccbe8e3374c29c6" and "6c191cf59e837ec222b9a4534a8165565d499da1" have entirely different histories.
6b24008c17
...
6c191cf59e
@ -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");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user