diff --git a/src/engine/store/plugin.rs b/src/engine/store/plugin.rs index 112ee0d..a681b6c 100644 --- a/src/engine/store/plugin.rs +++ b/src/engine/store/plugin.rs @@ -223,7 +223,29 @@ impl StrategyEngine { pair.strategy.reload(child, manifest).await?; } - self.spawn().await; + let engine = self.clone(); + tokio::spawn(async move { engine.run_strategy().await }); + + Ok(()) + } + + pub async fn reload_risk(self: &Arc, id: &str) -> tokio::io::Result<()> { + { + let pair = self.pair.lock().await; + + let plugin = pulse_plugin(id)?; + + let (child, manifest) = get_manifest_plugin_pair( + &plugin, + &plugin.join("risk.bash"), + &fs::read(plugin.join("risk.toml")).await?, + )?; + + pair.risk.reload(child, manifest).await?; + } + + let engine = self.clone(); + tokio::spawn(async move { engine.run_risk().await }); Ok(()) }