Пример #1
0
 def _wait_until_true(self, fn, timeout: int = 0) -> None:
     """Sleeps until fn is true"""
     start_time = time.monotonic()
     while not fn():
         if 0 < timeout <= time.monotonic() - start_time:
             raise AirflowWebServerTimeout(f"No response from gunicorn master within {timeout} seconds")
         sleep(0.1)
Пример #2
0
 def wait_until_true(fn, timeout=0):
     """
     Sleeps until fn is true
     """
     start_time = time.time()
     while not fn():
         if 0 < timeout <= time.time() - start_time:
             raise AirflowWebServerTimeout(
                 "No response from gunicorn master within {0} seconds".
                 format(timeout))
         time.sleep(0.1)