Skip to content

Commit

Permalink
Run reload handlers in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Jan 28, 2025
1 parent 6aa2e36 commit e3e6537
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/cli/src/lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ impl LifecycleManager {
.expect("Failed to read monotonic clock")
]);

// XXX: if the handler takes a long time, it will block the
// XXX: if one handler takes a long time, it will block the
// rest of the shutdown process, which is not ideal. We
// should probably have a timeout here
for handler in &self.reload_handlers {
handler().await;
}
futures_util::future::join_all(
self.reload_handlers
.iter()
.map(|handler| handler())
).await;

notify(&[sd_notify::NotifyState::Ready]);

Expand Down

0 comments on commit e3e6537

Please sign in to comment.