Skip to content

Commit

Permalink
Change retry time in case of failure to be set in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Rengyr committed Oct 28, 2024
1 parent 95e2d05 commit 8c82a7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"tags": "#Bot //optional setting",
"local_path": "./ //optional setting for local images",
"log_level": "Info",
"use_syslog_style": true
"use_syslog_style": true,
"retry_time": 600
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ fn main() {

//Check if it's time to post new image
if next_time < Local::now()
|| (failed_to_post && (Instant::now() - failed_to_post_time).as_secs() > 60 * 10)
|| (failed_to_post && (Instant::now() - failed_to_post_time).as_secs() > 60 * 2) // Try again in 2 minutes if posting failed
{
//Try again after 10min if failed
let image = post_image(&app_config, &images, &mut not_used_images);
Expand Down

0 comments on commit 8c82a7f

Please # to comment.