tenacity_stop.py 311 B

1234567891011
  1. from tenacity import RetryCallState
  2. from tenacity.stop import stop_base
  3. from openhands.utils.shutdown_listener import should_exit
  4. class stop_if_should_exit(stop_base):
  5. """Stop if the should_exit flag is set."""
  6. def __call__(self, retry_state: 'RetryCallState') -> bool:
  7. return should_exit()