diff --git a/nextcloud_mcp_server/app.py b/nextcloud_mcp_server/app.py index 6f8f0ecc..76b5a07d 100644 --- a/nextcloud_mcp_server/app.py +++ b/nextcloud_mcp_server/app.py @@ -1748,6 +1748,8 @@ def get_app(transport: str = "streamable-http", enabled_apps: list[str] | None = # Publish outstanding-work + corpus gauges on a fixed cadence, # independent of the consumer path and queue backend (fixes the # gauge reading 0 on the multi-user path; see metrics_publisher). + # receive_stream is None in postgres mode — get_ingest_pending + # falls back to the procrastinate job counts there. await tg.start( vector_sync_metrics_task, task_producer, @@ -1989,6 +1991,8 @@ def get_app(transport: str = "streamable-http", enabled_apps: list[str] | None = # oauth_processor_task, which never updated the queue gauge, # so without this the gauge read 0 while the buffer held # thousands of pending docs (see metrics_publisher). + # receive_stream is None in postgres mode — get_ingest_pending + # falls back to the procrastinate job counts there. await tg.start( vector_sync_metrics_task, task_producer, diff --git a/tests/unit/vector/test_metrics_publisher.py b/tests/unit/vector/test_metrics_publisher.py index 77ad7ddf..c533fcda 100644 --- a/tests/unit/vector/test_metrics_publisher.py +++ b/tests/unit/vector/test_metrics_publisher.py @@ -78,6 +78,15 @@ class TestCountIndexed: assert all(call.kwargs["exact"] is False for call in qc.count.await_args_list) + async def test_default_is_exact_true(self) -> None: + # The on-demand status endpoint relies on the exact=True default. + qc = AsyncMock() + qc.count.side_effect = [_count_obj(10), _count_obj(3)] + + await mp.count_indexed(qc, _COLLECTION) + + assert all(call.kwargs["exact"] is True for call in qc.count.await_args_list) + class TestPublishVectorSyncMetrics: @pytest.fixture(autouse=True) diff --git a/third_party/astrolabe b/third_party/astrolabe index 8a26b8d9..54adb28f 160000 --- a/third_party/astrolabe +++ b/third_party/astrolabe @@ -1 +1 @@ -Subproject commit 8a26b8d9bf42649488aab29f220cde8d3764cf2c +Subproject commit 54adb28f1d10ac5c143ca28e853d4289fdd0a69b