diff options
| author | stuebinm | 2024-04-16 22:14:40 +0200 | 
|---|---|---|
| committer | stuebinm | 2024-04-16 22:14:40 +0200 | 
| commit | c4bedb1756c96db3f7d01feedc6587f7b0c3dc0f (patch) | |
| tree | 86cf4b28ec513f8a104f19d21c132f1551539282 | |
| parent | bade89a506c380a7d4cab4fdd765e28686c14776 (diff) | |
not sure how my thought process went wrong here (perhaps i only
considered ntfy might reject the request for auth reasons?), but as it
was if ntfy was ever not available this thing would just fail
permanently.
| -rw-r--r-- | src/main.rs | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index ed9c8a7..6e8b82d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@  use tokio::sync::Mutex; -use std::{process::exit, sync::Arc, path::PathBuf, str::FromStr}; +use std::{sync::Arc, path::PathBuf, str::FromStr};  use matrix_sdk::{      config::SyncSettings, ruma::{events::room::message::RoomMessageEventContent, OwnedRoomOrAliasId}, Client, Room, encryption::EncryptionSettings,  }; @@ -152,8 +152,9 @@ async fn read_ntfy(config: &Options, rooms_to_notify: Arc<Mutex<Vec<Room>>>) ->      };      if !req.status().is_success() { -        tracing::error!("fatal: ntfy sent status {}", req.status()); -        exit(1); +        tracing::error!("ntfy sent status {}, will retry ..", req.status()); +        tokio::time::sleep(tokio::time::Duration::from_millis(5000)).await; +        return Ok(());      }      let stream = req  | 
