pub fn run_process_until_exited_successfully(
    command: Command,
    timeout: u64,
    max_attempts: i32,
    command_description: &str,
    error_description: &str
)
Expand description

Runs command for n times with m second interval.

Panics

Panics if max_attempts is exceeded and none of attempts return successful exit code.

Arguments

  • command - Command which will be invoked
  • timeout - Timeout after unsuccesful attempt (in seconds)
  • max_attempts - Maximum number of attempts
  • command_description - User description of command
  • error_description - User description of error

Example

use process_utils::run_process_until_exited_successfully;

process_utils::run_process_until_exited_successfully( jcli_wrapper::run_rest_stats_command_default(), 2, 5, “get stats from jormungandr node”, “jormungandr node is not up” );