Skip to content

Commit

Permalink
Fix execution bug in cli executor
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Jan 14, 2025
1 parent c5ac389 commit a7c10d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@ impl JobExecutor for Executor {
if self.promise_jobs.borrow().is_empty() && self.async_jobs.borrow().is_empty() {
return;
}

let jobs = std::mem::take(&mut *self.promise_jobs.borrow_mut());
for job in jobs {
if let Err(e) = job.call(context) {
eprintln!("Uncaught {e}");
}
}

let async_jobs = std::mem::take(&mut *self.async_jobs.borrow_mut());
for async_job in async_jobs {
if let Err(err) = pollster::block_on(async_job.call(&RefCell::new(context))) {
Expand Down

0 comments on commit a7c10d3

Please sign in to comment.