mirror of
https://github.com/FliegendeWurst/telegram_notes_bot.git
synced 2024-09-07 21:21:22 +00:00
Update dependencies
This commit is contained in:
parent
fb5f119de1
commit
be147764ea
870
Cargo.lock
generated
870
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -6,9 +6,9 @@ license = "GPL-3.0+"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "0.2.22", features = ["full"] }
|
||||
telegram-bot = "0.7.0"
|
||||
reqwest = { version = "0.10.4", features = ["json", "blocking"] }
|
||||
tokio = { version = "1.2.0", features = ["full"] }
|
||||
telegram-bot = { git = "https://github.com/telegram-rs/telegram-bot", rev = "07a9f9a1c76eaab2259bdc6241691187a46d69d1" }
|
||||
reqwest = { version = "0.11.1", features = ["json", "blocking"] }
|
||||
chrono = { version = "0.4.11", features = ["serde"] }
|
||||
url = "2.1.0"
|
||||
futures-util = "0.3.4"
|
||||
|
@ -59,6 +59,8 @@ pub enum Error {
|
||||
Network(#[from] reqwest::Error),
|
||||
#[error("telegram error: {0}")]
|
||||
Telegram(#[from] telegram_bot::Error),
|
||||
#[error("json parsing error: {0}")]
|
||||
Json(#[from] serde_json::Error),
|
||||
#[error("mime parsing error: {0}")]
|
||||
Mime(#[from] mime::FromStrError),
|
||||
#[error("chrono parsing error: {0}")]
|
||||
|
14
src/main.rs
14
src/main.rs
@ -237,9 +237,9 @@ async fn event_alerts() {
|
||||
println!("error: {}", e);
|
||||
}
|
||||
while Local::now().minute() == last_min {
|
||||
tokio::time::delay_for(Duration::from_secs(1)).await;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
tokio::time::delay_for(Duration::from_secs(16)).await;
|
||||
tokio::time::sleep(Duration::from_secs(16)).await;
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,7 +250,8 @@ async fn event_alerts_soon() -> Result<(), Error> {
|
||||
let events: Result<Vec<Event>, _> = serde_json::from_str(&text);
|
||||
if events.is_err() {
|
||||
eprintln!("failed to parse {}", text);
|
||||
return events.into();
|
||||
events?;
|
||||
unreachable!() // needed to please the borrow checker
|
||||
}
|
||||
let events = events.unwrap();
|
||||
for event in events {
|
||||
@ -286,9 +287,9 @@ async fn task_alerts() {
|
||||
println!("error: {}", e);
|
||||
}
|
||||
while Local::now().minute() == last_min {
|
||||
tokio::time::delay_for(Duration::from_secs(1)).await;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
tokio::time::delay_for(Duration::from_secs(1)).await;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +300,8 @@ async fn task_alerts_soon() -> Result<(), Error> {
|
||||
let tasks: Result<Vec<Task>, _> = serde_json::from_str(&text);
|
||||
if tasks.is_err() {
|
||||
eprintln!("failed to parse {}", text);
|
||||
return tasks.into();
|
||||
tasks?;
|
||||
unreachable!() // needed to please the borrow checker
|
||||
}
|
||||
let tasks = tasks.unwrap();
|
||||
'task: for task in tasks {
|
||||
|
Loading…
Reference in New Issue
Block a user