fix: proper executor shutdown in querier

This is not a huge issue but might drain resources like file descriptors
during tests. The dedicated exuector also logs a warning.
pull/24376/head
Marco Neumann 2022-04-13 15:51:12 +02:00
parent d829db6e5d
commit f75d3b1f5d
2 changed files with 7 additions and 0 deletions

View File

@ -134,6 +134,11 @@ impl QuerierDatabase {
.await
.expect("retry forever")
}
/// Executor
pub(crate) fn exec(&self) -> &Executor {
&self.exec
}
}
#[cfg(test)]

View File

@ -90,10 +90,12 @@ impl QuerierHandler for QuerierHandlerImpl {
}
self.shutdown.cancelled().await;
self.database.exec().join().await;
}
fn shutdown(&self) {
self.shutdown.cancel();
self.database.exec().shutdown();
}
}