mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-12-28 00:39:25 -05:00
debug command crash fix
This commit is contained in:
parent
2bb43cebaf
commit
25d804f11a
@ -340,6 +340,14 @@ impl NetworkManager {
|
||||
.connection_manager
|
||||
.clone()
|
||||
}
|
||||
pub fn opt_connection_manager(&self) -> Option<ConnectionManager> {
|
||||
self.unlocked_inner
|
||||
.components
|
||||
.read()
|
||||
.as_ref()
|
||||
.map(|x| x.connection_manager.clone())
|
||||
}
|
||||
|
||||
pub fn update_callback(&self) -> UpdateCallback {
|
||||
self.unlocked_inner
|
||||
.update_callback
|
||||
|
@ -853,15 +853,20 @@ impl VeilidAPI {
|
||||
Ok("Buckets purged".to_owned())
|
||||
} else if args[0] == "connections" {
|
||||
// Purge connection table
|
||||
let connection_manager = self.network_manager()?.connection_manager();
|
||||
connection_manager.shutdown().await;
|
||||
let opt_connection_manager = self.network_manager()?.opt_connection_manager();
|
||||
|
||||
if let Some(connection_manager) = &opt_connection_manager {
|
||||
connection_manager.shutdown().await;
|
||||
}
|
||||
|
||||
// Eliminate last_connections from routing table entries
|
||||
self.network_manager()?
|
||||
.routing_table()
|
||||
.purge_last_connections();
|
||||
|
||||
connection_manager.startup().await;
|
||||
if let Some(connection_manager) = &opt_connection_manager {
|
||||
connection_manager.startup().await;
|
||||
}
|
||||
|
||||
Ok("Connections purged".to_owned())
|
||||
} else if args[0] == "routes" {
|
||||
|
Loading…
Reference in New Issue
Block a user