main: Panic explicitely when failing to initialize the state db

This commit is contained in:
2025-05-15 21:01:59 +00:00
parent 86c6ec26f5
commit 3fee20f0cf

View File

@ -51,13 +51,14 @@ async fn main() -> anyhow::Result<()> {
}); });
let config = Arc::new(config); let config = Arc::new(config);
let state_db = FeedReaderStateDb::new("state.yaml").await.unwrap_or_else(|e| {
panic!("Failed to initialize feed reader state db: {e:?}")
});
// This message passing channel is used for sending messages to the matrix module, // This message passing channel is used for sending messages to the matrix module,
// it holds a tuple with an HTML message and a list of rooms to post to // it holds a tuple with an HTML message and a list of rooms to post to
let (bcast_tx, bcast_rx) = broadcast::channel(1024); let (bcast_tx, bcast_rx) = broadcast::channel(1024);
let state_db = FeedReaderStateDb::new("state.yaml").await
.expect("Failed to initialize feed reader state db");
let handles: Vec<JoinHandle<_>> = config.feeds.clone().into_iter().map(|feed_config| { let handles: Vec<JoinHandle<_>> = config.feeds.clone().into_iter().map(|feed_config| {
let state_db = Arc::clone(&state_db); let state_db = Arc::clone(&state_db);
let bcast_tx = bcast_tx.clone(); let bcast_tx = bcast_tx.clone();