Skip to content

Commit

Permalink
plugin load when adminspace entry for this plugin added (#952)
Browse files Browse the repository at this point in the history
* load but hangs

* start plugin should be performed outside of validator

* minimise diff
  • Loading branch information
milyin authored Apr 19, 2024
1 parent 92df88b commit 2c7e3c4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions zenoh/src/net/runtime/adminspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ impl ConfigValidator for AdminSpace {
current: &serde_json::Map<String, serde_json::Value>,
new: &serde_json::Map<String, serde_json::Value>,
) -> ZResult<Option<serde_json::Map<String, serde_json::Value>>> {
let plugins_mgr = zlock!(self.context.plugins_mgr);
let plugin = plugins_mgr.started_plugin(name).ok_or(format!(
"Plugin `{}` is not running, but its configuration is being changed",
name
))?;
let plugin_mgr = zlock!(self.context.plugins_mgr);
let Some(plugin) = plugin_mgr.started_plugin(name) else {
tracing::warn!("Plugin `{}` is not started", name);
// If plugin not started, just allow any config. The plugin `name` will be attempted to start with this config
// on config comparison (see `PluginDiff`)
return Ok(None);
};
plugin.instance().config_checker(path, current, new)
}
}
Expand Down

0 comments on commit 2c7e3c4

Please sign in to comment.