refactor websocket veilid_config and update scripts

This commit is contained in:
John Smith
2021-12-09 16:00:47 -05:00
parent de36b0d6d6
commit ea8ffea1c9
19 changed files with 797 additions and 145 deletions
+8 -4
View File
@@ -163,15 +163,13 @@ impl VeilidCore {
match self.internal_startup(&mut *inner, setup).await {
Ok(v) => Ok(v),
Err(e) => {
self.clone().internal_shutdown().await;
Self::internal_shutdown(&mut *inner).await;
Err(e)
}
}
}
// stop the node gracefully because the veilid api was dropped
pub(crate) async fn internal_shutdown(self) {
let mut inner = self.inner.lock();
async fn internal_shutdown(inner: &mut VeilidCoreInner) {
trace!("VeilidCore::internal_shutdown starting");
// Detach the API object
@@ -204,5 +202,11 @@ impl VeilidCore {
trace!("VeilidCore::shutdown complete");
}
// stop the node gracefully because the veilid api was dropped
pub(crate) async fn shutdown(self) {
let mut inner = self.inner.lock();
Self::internal_shutdown(&mut *inner);
}
//
}