def wait_for_redis_worker(job, timeout=5):
 start_time = time.time()
 while ((time.time() - start_time) < timeout):
  if (job.result == REDIS_SUCCESS_RETURN_VALUE):
   return
  elif (job.result not in (None, REDIS_SUCCESS_RETURN_VALUE)):
   assert False, 'Redis worker failed!'
  time.sleep(0.1)
 assert False, 'Redis worker timed out!'

def wait_for_redis_worker ( job , timeout = 5 ) : start_time = time . time ( ) while ( ( time . time ( ) - start_time ) < timeout ) : if ( job . result == REDIS_SUCCESS_RETURN_VALUE ) : return elif ( job . result not in ( None , REDIS_SUCCESS_RETURN_VALUE ) ) : assert False , 'Redis worker failed!' time . sleep ( 0.1 ) assert False , 'Redis worker timed out!'
raise an error if the redis job doesnt complete successfully before a timeout .