def timeout_check()

in src/neper_healthcheck/neper_runner.py [0:0]


def timeout_check(start_time: float, pod_name: str) -> bool:
  """Check if we exceed allocated timeout to get host name from that pod_name.

  Args:
    start_time (float): Time when we start checking the pod.
    pod_name (str): The name of the pod to be checked.

  Returns:
    bool

  Raises:
    TimeoutError: If the pod has been running longer than the allocated timeout.
  """
  elapsed_time = time.time() - start_time
  if elapsed_time >= 10 * 60:  # 10 minutes
    raise TimeoutError(
        f"10min Timeout reached while trying to ssh to pod {pod_name}"
    )
  return True