diff --git a/plugins/tedge_apama_plugin/src/main.rs b/plugins/tedge_apama_plugin/src/main.rs index 34738f5d207..2c7fb65117a 100644 --- a/plugins/tedge_apama_plugin/src/main.rs +++ b/plugins/tedge_apama_plugin/src/main.rs @@ -177,6 +177,7 @@ fn install_project(project_archive_path: &Path) -> Result<(), InternalError> { println!("Installation of new project successful"); restart_apama_service()?; + wait_for_apama_correlator_ready()?; Ok(()) } @@ -188,6 +189,13 @@ fn restart_apama_service() -> Result<(), InternalError> { Ok(()) } +fn wait_for_apama_correlator_ready() -> Result<(), InternalError> { + println!("Waiting for apama correator to be ready for upto 10 seconds"); + run_cmd(APAMA_ENV_EXE, "engine_management --waitFor 10")?; + println!("Apama correator is ready"); + Ok(()) +} + fn remove_project(_project_name: &str) -> Result<(), InternalError> { let tedge_apama_project_path: &Path = Path::new(TEDGE_APAMA_PROJECT_DIR);