mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-08 21:24:56 -05:00
Retina 0.3.2, better TEARDOWNs
This commit is contained in:
4
server/Cargo.lock
generated
4
server/Cargo.lock
generated
@@ -1870,9 +1870,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "retina"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "819b5befff8af9b03e21256d577d101754527eb981dcd2804cb8725ce1dca978"
|
||||
checksum = "c9d52cea718605a7425537d1859af58d3b1ea669b5572faf481eb6fe7310da17"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bitreader",
|
||||
|
||||
@@ -46,7 +46,7 @@ nom = "7.0.0"
|
||||
parking_lot = { version = "0.11.1", features = [] }
|
||||
protobuf = { git = "https://github.com/stepancheg/rust-protobuf" }
|
||||
reffers = "0.6.0"
|
||||
retina = "0.3.1"
|
||||
retina = "0.3.2"
|
||||
ring = "0.16.2"
|
||||
rusqlite = "0.25.3"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
||||
@@ -116,19 +116,22 @@ where
|
||||
loop {
|
||||
let status = self.session_group.stale_sessions();
|
||||
if let Some(max_expires) = status.max_expires {
|
||||
if let Some(d) = max_expires.checked_duration_since(tokio::time::Instant::now()) {
|
||||
log::info!(
|
||||
"{}: Waiting {:?} for {} stale sessions to expire",
|
||||
&self.short_name,
|
||||
d,
|
||||
status.num_sessions
|
||||
);
|
||||
self.shutdown_rx.wait_for(d)?;
|
||||
waited = true;
|
||||
}
|
||||
log::info!(
|
||||
"{}: waiting up to {:?} for TEARDOWN or expiration of {} stale sessions",
|
||||
&self.short_name,
|
||||
max_expires.saturating_duration_since(tokio::time::Instant::now()),
|
||||
status.num_sessions
|
||||
);
|
||||
tokio::runtime::Handle::current().block_on(async {
|
||||
tokio::select! {
|
||||
_ = self.session_group.await_stale_sessions(&status) => Ok(()),
|
||||
_ = self.shutdown_rx.as_future() => Err(base::shutdown::ShutdownError),
|
||||
}
|
||||
})?;
|
||||
waited = true;
|
||||
} else {
|
||||
if waited {
|
||||
log::info!("{}: Done waiting", &self.short_name);
|
||||
log::info!("{}: done waiting; no more stale sessions", &self.short_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user