12 lines
286 B
Python
12 lines
286 B
Python
import sys
|
|
import time
|
|
|
|
from loop_claude.outcome import Stop
|
|
|
|
|
|
def stop_or_sleep_a_minute(who, failures, reason):
|
|
if failures == 3:
|
|
return Stop(1, f"the {who} failed three times running: {reason}")
|
|
print(f"retrying the {who} in a minute: {reason}", file=sys.stderr)
|
|
time.sleep(60)
|