diff --git a/src/main.rs b/src/main.rs index ac5d8db..8c7ec71 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,12 +44,20 @@ async fn main() { let items = result.content.items; debug!("received {:?} items to handle...", items.len()); for item in items { - if database.get(&item.id).is_ok_and(|r| r.is_some()) { - debug!( - "item `{}` for channel `{c}` already processed; skip handle.", + match database.get(&item.id) { + Ok(id) => { + if id.is_some() { + debug!( + "item `{}` for channel `{c}` already processed; skip handle.", + item.id + ); + continue; + } + } + Err(e) => panic!( + "can't check item `{}` in DB for channel `{c}`: {e}", item.id - ); - continue; + ), } if item.is_live != channel.is_live { debug!( @@ -85,7 +93,7 @@ async fn main() { "exec `{cmd}` for channel `{c}` successful: `{:?}`", response ), - Err(e) => error!( + Err(e) => panic!( "can't persist processed item `{}` for channel `{c}` by `{cmd}`: `{e}`", item.id ),