Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Commit

Permalink
Log job queue overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
semoro committed May 8, 2021
1 parent 85f2965 commit e631443
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ struct Jobs {
impl Jobs {
fn start<F: FnOnce() -> Output + Send + 'static>(&mut self, f: F) -> JobId {
let (tx, rx) = mpsc::channel();
self.pool.execute_to(tx, Thunk::of(|| f()));
if self.pool.queued_count() > self.pool.max_count() {
log::warn!("Job queue filling up (active {}, queued {})", self.pool.active_count(), self.pool.queued_count());
}

self.pool.execute_to(tx, Thunk::of(f));
let id = self.next_job.to_string();
self.next_job += 1;
self.map.insert(id.clone(), Job { rx });
Expand Down

0 comments on commit e631443

Please sign in to comment.