main: Panic explicitely when failing to initialize the state db
This commit is contained in:
@ -51,13 +51,14 @@ async fn main() -> anyhow::Result<()> {
|
||||
});
|
||||
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,
|
||||
// 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 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 state_db = Arc::clone(&state_db);
|
||||
let bcast_tx = bcast_tx.clone();
|
||||
|
Reference in New Issue
Block a user