Improved reloading
This commit is contained in:
@@ -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(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user