Only counting files in the current refresh job as unindexed, clearing refresh job between runs.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2025-12-21 16:06:39 -07:00
parent af15d59950
commit 8eecd3283a
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -746,6 +746,7 @@ async def refresh_files(paths: List[pathlib.Path] = None, send_events: bool = Tr
Events.send_refresh_completed()
api_app.shared_ctx.refresh['counted_files'] = 0
api_app.shared_ctx.refresh['idempotency'] = None
async def apply_indexers():
@ -1198,10 +1199,10 @@ def get_refresh_progress() -> RefreshProgress:
stmt = '''
SELECT
-- Sum all the files in each FileGroup.
SUM(json_array_length(files)) FILTER (WHERE idempotency = %(idempotency)s) AS "total_file_groups",
COUNT(id) FILTER (WHERE indexed IS TRUE AND idempotency = %(idempotency)s) AS "indexed",
COUNT(id) FILTER (WHERE indexed IS FALSE) AS "unindexed",
COUNT(id) FILTER (WHERE model IS NOT NULL AND idempotency = %(idempotency)s) AS "modeled"
SUM(json_array_length(files)) FILTER (WHERE idempotency = %(idempotency)s) AS "total_file_groups",
COUNT(id) FILTER (WHERE indexed IS TRUE AND idempotency = %(idempotency)s) AS "indexed",
COUNT(id) FILTER (WHERE indexed IS FALSE AND idempotency = %(idempotency)s) AS "unindexed",
COUNT(id) FILTER (WHERE model IS NOT NULL AND idempotency = %(idempotency)s) AS "modeled"
FROM file_group \
'''
else: