From a546a8a072393b147bf365cfdfd4c917cac4fc5e Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 27 Dec 2019 12:50:27 +0100 Subject: [PATCH] proxy/api: await running workers before shutdown Signed-off-by: Wolfgang Bumiller --- src/bin/proxmox-backup-api.rs | 2 ++ src/bin/proxmox-backup-proxy.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/bin/proxmox-backup-api.rs b/src/bin/proxmox-backup-api.rs index 9062304a..630d642c 100644 --- a/src/bin/proxmox-backup-api.rs +++ b/src/bin/proxmox-backup-api.rs @@ -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"); diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index 788c3e9d..b31f8334 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -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(())