Check if daemon should shutdown. Returns: True if shutdown signal detected, False otherwise
()
| 714 | |
| 715 | |
| 716 | def should_shutdown() -> bool: |
| 717 | """Check if daemon should shutdown. |
| 718 | |
| 719 | Returns: |
| 720 | True if shutdown signal detected, False otherwise |
| 721 | """ |
| 722 | # Check for shutdown signal file |
| 723 | shutdown_file = DAEMON_DIR / "shutdown.signal" |
| 724 | if shutdown_file.exists(): |
| 725 | logging.info("Shutdown signal detected") |
| 726 | try: |
| 727 | shutdown_file.unlink() |
| 728 | except KeyboardInterrupt as ki: |
| 729 | handle_keyboard_interrupt(ki) |
| 730 | raise |
| 731 | except Exception: |
| 732 | pass |
| 733 | return True |
| 734 | return False |
| 735 | |
| 736 | |
| 737 | def signal_handler(signum: int, frame: object) -> None: |
no test coverage detected