in src/hpcadvisor/utils.py [0:0]
def wait_until(wait_until_function, timeout_in_mins=20):
wait_time_block = 15
count_down = (timeout_in_mins * 60) // wait_time_block
while count_down > 0:
rc = wait_until_function()
if rc is WAIT_UNTIL_FUNCTION_RC.SUCCESS:
return WAIT_UNTIL_RC.SUCCESS
elif rc is WAIT_UNTIL_FUNCTION_RC.CANCEL_WAIT:
return WAIT_UNTIL_RC.FAILURE
elif rc is WAIT_UNTIL_FUNCTION_RC.CONTINUE_WAIT:
time.sleep(wait_time_block)
count_down -= 1
return WAIT_UNTIL_RC.TIMEOUT