Loading crates/arti-client/src/client.rs +0 −14 Original line number Diff line number Diff line Loading @@ -1008,20 +1008,6 @@ async fn continually_expire_channels<R: Runtime>(rt: R, chanmgr: Weak<tor_chanmg } } impl<R: Runtime> Drop for TorClient<R> { // TODO: Consider moving this into tor-circmgr after we have more // experience with the state system. fn drop(&mut self) { match self.circmgr.store_persistent_state() { Ok(()) => info!("Flushed persistent state at exit."), Err(tor_circmgr::Error::State(tor_persist::Error::NoLock)) => { debug!("Lock not held; no state to flush."); } Err(e) => error!("Unable to flush state on client exit: {}", e), } } } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] Loading crates/tor-circmgr/src/lib.rs +13 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ use tor_rtcompat::Runtime; use std::convert::TryInto; use std::sync::{Arc, Mutex}; use std::time::Instant; use tracing::{debug, info, warn}; use tracing::{debug, error, info, warn}; pub mod build; mod config; Loading Loading @@ -434,6 +434,18 @@ impl<R: Runtime> CircMgr<R> { } } impl<R: Runtime> Drop for CircMgr<R> { fn drop(&mut self) { match self.store_persistent_state() { Ok(()) => info!("Flushed persistent state at exit."), Err(Error::State(tor_persist::Error::NoLock)) => { debug!("Lock not held; no state to flush."); } Err(e) => error!("Unable to flush state on circuit manager drop: {}", e), } } } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] Loading Loading
crates/arti-client/src/client.rs +0 −14 Original line number Diff line number Diff line Loading @@ -1008,20 +1008,6 @@ async fn continually_expire_channels<R: Runtime>(rt: R, chanmgr: Weak<tor_chanmg } } impl<R: Runtime> Drop for TorClient<R> { // TODO: Consider moving this into tor-circmgr after we have more // experience with the state system. fn drop(&mut self) { match self.circmgr.store_persistent_state() { Ok(()) => info!("Flushed persistent state at exit."), Err(tor_circmgr::Error::State(tor_persist::Error::NoLock)) => { debug!("Lock not held; no state to flush."); } Err(e) => error!("Unable to flush state on client exit: {}", e), } } } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] Loading
crates/tor-circmgr/src/lib.rs +13 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ use tor_rtcompat::Runtime; use std::convert::TryInto; use std::sync::{Arc, Mutex}; use std::time::Instant; use tracing::{debug, info, warn}; use tracing::{debug, error, info, warn}; pub mod build; mod config; Loading Loading @@ -434,6 +434,18 @@ impl<R: Runtime> CircMgr<R> { } } impl<R: Runtime> Drop for CircMgr<R> { fn drop(&mut self) { match self.store_persistent_state() { Ok(()) => info!("Flushed persistent state at exit."), Err(Error::State(tor_persist::Error::NoLock)) => { debug!("Lock not held; no state to flush."); } Err(e) => error!("Unable to flush state on circuit manager drop: {}", e), } } } #[cfg(test)] mod test { #![allow(clippy::unwrap_used)] Loading