proxy/api: await running workers before shutdown

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-12-27 12:50:27 +01:00
parent 3332a91426
commit a546a8a072
2 changed files with 4 additions and 0 deletions

View File

@ -81,6 +81,8 @@ async fn run() -> Result<(), Error> {
}
server.await?;
log::info!("server shutting down, waiting for active workers to complete");
proxmox_backup::server::last_worker_future().await?;
log::info!("done - exit server");

View File

@ -112,6 +112,8 @@ async fn run() -> Result<(), Error> {
}
server.await?;
log::info!("server shutting down, waiting for active workers to complete");
proxmox_backup::server::last_worker_future().await?;
log::info!("done - exit server");
Ok(())