Skip to content

Commit

Permalink
update backon
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Sep 11, 2024
1 parent 3c069f8 commit 1d971d5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
28 changes: 3 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
async-trait = "0.1"
backon = "0.4.1"
backon = { version = "1.2", default-features = false, features = ["tokio-sleep"] }
calibright = { version = "0.1.6", features = ["watch"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "unstable-locales"] }
chrono-tz = { version = "0.8", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/external_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub async fn run(config: &Config, api: &CommonApi) -> Result<()> {

loop {
let fetch_info = || IPAddressInfo::new(client);
let info = fetch_info.retry(&ExponentialBuilder::default()).await?;
let info = fetch_info.retry(ExponentialBuilder::default()).await?;

let mut values = map! {
"ip" => Value::text(info.ip),
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async fn get_stats(token: &str) -> Result<HashMap<String, usize>> {
let mut total = 0;
for page in 1..100 {
let fetch = || get_on_page(token, page);
let on_page = fetch.retry(&ExponentialBuilder::default()).await?;
let on_page = fetch.retry(ExponentialBuilder::default()).await?;
if on_page.is_empty() {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/weather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ pub async fn run(config: &Config, api: &CommonApi) -> Result<()> {
loop {
let location = if config.autolocate {
let fetch = || find_ip_location(autolocate_interval.0);
Some(fetch.retry(&ExponentialBuilder::default()).await?)
Some(fetch.retry(ExponentialBuilder::default()).await?)
} else {
None
};

let fetch = || provider.get_weather(location.as_ref(), need_forecast);
let data = fetch.retry(&ExponentialBuilder::default()).await?;
let data = fetch.retry(ExponentialBuilder::default()).await?;
let data_values = data.into_values();

loop {
Expand Down

0 comments on commit 1d971d5

Please sign in to comment.