Improved reloading

This commit is contained in:
2026-07-26 15:47:19 +02:00
parent ee0ba0fe69
commit 782ea4f92d
+23 -1
View File
@@ -223,7 +223,29 @@ impl StrategyEngine {
pair.strategy.reload(child, manifest).await?; 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<Self>, 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(()) Ok(())
} }