Skip to content

Commit

Permalink
fix senderror when there are no subscribers to mensa changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fnschmidt committed Oct 11, 2024
1 parent 7773c41 commit 3e6078f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/cronjobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ pub async fn update_cache(

if let Some(tx) = today_updated_tx.as_ref() {
for canteen_diff in &canteens_changed_today {
tx.send(canteen_diff.clone()).unwrap();
match tx.send(canteen_diff.clone()) {
Ok(subs) => {
log::info!("Broadcasted canteen diff to {} subscribers", subs);
}
Err(_) => {
log::debug!("No subscribers listening to canteen diff broadcast");
}
}
}
}

Expand Down

0 comments on commit 3e6078f

Please sign in to comment.