Browse Source

Change env var

master
Victor Roest 1 year ago
parent
commit
1734608ac5
Signed by: 0x76 GPG Key ID: A3923C699D1A3BDA
  1. 7
      src/main.rs

7
src/main.rs

@ -52,7 +52,7 @@ fn main() {
let mut interval = Duration::from_secs(30);
let api_url = match std::env::var("API_URL") {
let api_url = match std::env::var("WEBHOOK_URLS") {
Ok(url) => url,
Err(e) => panic!("API_URL is not defined! {}", e)
};
@ -62,14 +62,11 @@ fn main() {
Err(e) => panic!("Getting first xkcd failed! {}", e)
};
// TODO: remove, for testing
latest.num = latest.num - 1;
loop {
if let Ok(current) = get_latest_xkcd() {
if current.num != latest.num {
match send_xkcd(&api_url, current.num) {
Ok(_) => interval = Duration::from_secs(30),
Ok(_) => interval = Duration::from_secs(30),
Err(err) => {
println!("Encounter error: {}", err);
interval = backoff(interval);

Loading…
Cancel
Save