mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 12:37:00 +01:00
Improve tasks daemon shutdown (#1806)
This commit is contained in:
parent
83e4d3a85e
commit
12121bae37
|
@ -330,6 +330,7 @@ async fn main() -> ExitCode {
|
|||
debug!("Attempting to use {} ...", task_sock_path);
|
||||
|
||||
let (broadcast_tx, mut broadcast_rx) = broadcast::channel(4);
|
||||
let mut d_broadcast_rx = broadcast_tx.subscribe();
|
||||
|
||||
let server = tokio::spawn(async move {
|
||||
loop {
|
||||
|
@ -345,7 +346,14 @@ async fn main() -> ExitCode {
|
|||
info!("Found kanidm_unixd, waiting for tasks ...");
|
||||
// Yep! Now let the main handler do it's job.
|
||||
// If it returns (dc, etc, then we loop and try again).
|
||||
handle_tasks(stream, &cfg).await;
|
||||
tokio::select! {
|
||||
_ = d_broadcast_rx.recv() => {
|
||||
break;
|
||||
}
|
||||
_ = handle_tasks(stream, &cfg) => {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
debug!("\\---> {:?}", e);
|
||||
|
|
Loading…
Reference in a new issue