mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
fix(core): drop active_transfers guard before await in status
Clippy await_holding_lock failed because the sync MutexGuard lived across the active_shares.lock().await in the RuntimeStatus struct expr.
This commit is contained in:
@@ -494,15 +494,17 @@ impl CoreInner {
|
||||
}
|
||||
|
||||
async fn status(&self) -> RuntimeStatus {
|
||||
RuntimeStatus {
|
||||
endpoint_id: self.endpoint.id().to_string(),
|
||||
addr: format!("{:?}", self.endpoint.addr()),
|
||||
active_transfers: self
|
||||
let active_transfers = self
|
||||
.active_transfers
|
||||
.lock()
|
||||
.expect("active_transfers")
|
||||
.len() as u64,
|
||||
active_shares: self.active_shares.lock().await.len() as u64,
|
||||
.len() as u64;
|
||||
let active_shares = self.active_shares.lock().await.len() as u64;
|
||||
RuntimeStatus {
|
||||
endpoint_id: self.endpoint.id().to_string(),
|
||||
addr: format!("{:?}", self.endpoint.addr()),
|
||||
active_transfers,
|
||||
active_shares,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user