fix: Reduce watch service CPU usage by increasing reload interval (#458)

Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
This commit is contained in:
Paul Hernandez
2025-12-17 11:37:01 -06:00
committed by GitHub
parent 0c12a39a98
commit 897b1edaa4
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -122,7 +122,9 @@ class BasicMemoryConfig(BaseSettings):
)
watch_project_reload_interval: int = Field(
default=30, description="Seconds between reloading project list in watch service", gt=0
default=300,
description="Seconds between reloading project list in watch service. Higher values reduce CPU usage by minimizing watcher restarts. Default 300s (5 min) balances efficiency with responsiveness to new projects.",
gt=0,
)
# update permalinks on move
+2 -2
View File
@@ -85,8 +85,8 @@ async def test_run_handles_no_projects():
with patch.object(watch_service, "write_status", return_value=None):
await watch_service.run()
# Should have slept for 30 seconds when no projects found
mock_sleep.assert_called_with(30)
# Should have slept for the configured reload interval when no projects found
mock_sleep.assert_called_with(config.watch_project_reload_interval)
@pytest.mark.asyncio