Features: - New GraphQL query 'isRinging' returns true/false if wecker is active - Checks the wecker process via PID file (PID_FILE in common.py) DRY refactoring: - Extract PID_FILE into shared common.py module - Both wecker.py and api/schema.py import from common - DRY enforcement tests verify identity (is) not just equality Tests: - test_is_ringing_returns_false_when_not_running - test_is_ringing_returns_true_when_running - test_pid_file_defined_once_across_modules (DRY enforcement) - test_pid_file_same_shared_constant_in_api (DRY enforcement) - Cleaned up unused imports in test_single_instance.py Docs: - Updated README.md with isRinging query documentation
5 lines
237 B
Python
5 lines
237 B
Python
from pathlib import Path
|
|
|
|
# The PID file path — defined once here to avoid duplication.
|
|
# wecker.py writes this file when it starts; api/schema.py reads it to check state.
|
|
PID_FILE = str(Path(__file__).parent.absolute() / "wecker.pid") |