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