Backup-bdg/OpenHands
0
1from tenacity import RetryCallState2from tenacity.stop import stop_base3 4from openhands.utils.shutdown_listener import should_exit5 6 7class stop_if_should_exit(stop_base):8 """Stop if the should_exit flag is set."""9 10 def __call__(self, retry_state: 'RetryCallState') -> bool:11 return bool(should_exit())12 