Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
supress panics from remotes::poll (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
oppiliappan authored Mar 23, 2023
1 parent 28a8de7 commit 3f9a149
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/bleep/src/remotes/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@ impl Poller {
debouncer
.watcher()
.watch(&git_path, RecursiveMode::Recursive)
.unwrap();
.map_err(|e| {
let d = git_path.display();
error!(error = %e, path = %d, "path does not exist anymore");
})
.ok()?;
_debouncer = Some(debouncer);

info!(?reporef, ?git_path, "will reindex repo on git changes");
Expand Down Expand Up @@ -312,7 +316,11 @@ fn debounced_events(tx: flume::Sender<()>) -> Debouncer<RecommendedWatcher> {
Duration::from_secs(5),
None,
move |event: DebounceEventResult| match event {
Ok(events) if events.is_empty().not() => tx.send(()).unwrap(),
Ok(events) if events.is_empty().not() => {
if let Err(e) = tx.send(()) {
error!("{e}");
}
}
Ok(_) => debug!("no events received from debouncer"),
Err(err) => {
error!(?err, "repository monitoring");
Expand Down

0 comments on commit 3f9a149

Please sign in to comment.