work
This commit is contained in:
@@ -168,6 +168,7 @@ pub enum VeilidUpdate {
|
||||
Attachment {
|
||||
state: AttachmentState,
|
||||
},
|
||||
Shutdown,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -1216,28 +1217,6 @@ impl VeilidAPI {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// wait for a matching update
|
||||
pub async fn wait_for_update(
|
||||
&self,
|
||||
update: VeilidUpdate,
|
||||
timeout_ms: Option<u32>,
|
||||
) -> Result<(), VeilidAPIError> {
|
||||
match update {
|
||||
VeilidUpdate::Log {
|
||||
log_level: _,
|
||||
message: _,
|
||||
} => {
|
||||
// No point in waiting for a log
|
||||
}
|
||||
VeilidUpdate::Attachment { state } => {
|
||||
self.attachment_manager()?
|
||||
.wait_for_state(state, timeout_ms)
|
||||
.await;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Change api logging level if it is enabled
|
||||
pub async fn change_api_log_level(&self, log_level: VeilidConfigLogLevel) {
|
||||
ApiLogger::change_log_level(log_level.to_level_filter());
|
||||
|
Reference in New Issue
Block a user