()
| 627 | shutdown_event.set() |
| 628 | |
| 629 | def _stop(): |
| 630 | # Give the watcher loop a moment to exit |
| 631 | time.sleep(0.2) |
| 632 | try: |
| 633 | socketio.stop() |
| 634 | except Exception: |
| 635 | pass |
| 636 | # Ensure process exits |
| 637 | sys.exit(0) |
| 638 | |
| 639 | threading.Thread(target=_stop, daemon=True).start() |
| 640 |