mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
12 lines
311 B
Python
12 lines
311 B
Python
from tenacity import RetryCallState
|
|
from tenacity.stop import stop_base
|
|
|
|
from openhands.utils.shutdown_listener import should_exit
|
|
|
|
|
|
class stop_if_should_exit(stop_base):
|
|
"""Stop if the should_exit flag is set."""
|
|
|
|
def __call__(self, retry_state: 'RetryCallState') -> bool:
|
|
return should_exit()
|