From 50c2cadb9754468a02183e7585a30cbec3a027bc Mon Sep 17 00:00:00 2001 From: Albin Suresh Date: Fri, 10 Dec 2021 16:54:07 +0530 Subject: [PATCH] Wait for apama correlator ready after project install (#702) --- plugins/tedge_apama_plugin/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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);