Skip to content

Commit

Permalink
Wait for apama correlator ready after project install (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
albinsuresh authored Dec 10, 2021
1 parent 846c1dc commit 50c2cad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/tedge_apama_plugin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand All @@ -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);

Expand Down

0 comments on commit 50c2cad

Please sign in to comment.