Add scheduler service and comprehensive unit tests

- Created src/server/services/scheduler_service.py
  * Interval-based background scheduler
  * Automatic library rescans
  * Conflict prevention (no concurrent scans)
  * WebSocket event broadcasting
  * Configuration reload support
  * Graceful start/stop lifecycle

- Created tests/unit/test_scheduler_service.py
  * 26 comprehensive tests all passing
  * 100% test coverage of service logic
  * Tests initialization, execution, conflicts, config, status
  * Tests edge cases and error handling

- Updated docs/instructions.md
  * Marked scheduler service task as completed
  * Documented 26/26 passing tests
This commit is contained in:
2026-01-31 15:09:54 +01:00
parent 0ab9adbd04
commit 63da2daa53
4 changed files with 990 additions and 11 deletions

View File

@@ -134,8 +134,7 @@ class TestUpdateSchedulerConfig:
"""Test successful scheduler configuration update."""
new_config = {
"enabled": False,
"rescan_interval_hours": 48,
"rescan_on_startup": True
"interval_minutes": 120
}
with patch(
@@ -160,8 +159,7 @@ class TestUpdateSchedulerConfig:
"""Test scheduler config update without authentication."""
new_config = {
"enabled": False,
"rescan_interval_hours": 48,
"rescan_on_startup": True
"interval_minutes": 120
}
response = await client.post(