| 502 | stop_event.set() |
| 503 | |
| 504 | async def _timer() -> None: |
| 505 | nonlocal timed_out |
| 506 | if ready_deadline is None: |
| 507 | return |
| 508 | try: |
| 509 | now = time.time() |
| 510 | remaining = max(0.0, ready_deadline - now) |
| 511 | await asyncio.sleep(remaining) |
| 512 | if not stop_event.is_set(): |
| 513 | timed_out = True |
| 514 | stop_event.set() |
| 515 | except Exception: |
| 516 | # best-effort timeout |
| 517 | if not stop_event.is_set(): |
| 518 | timed_out = True |
| 519 | stop_event.set() |
| 520 | |
| 521 | # After command start/finish, optionally compute a filesystem snapshot for auto-resync |
| 522 | if detached: |