files: shared modeler batch loop for video, doc, zim, archive (#722)

* files: shared modeler batch loop for video, doc, zim, archive

Paging, skip-ids, progress, and cancel yields live in
wrolpi.files.modeler.run_modeler_loop.  Each module still owns select /
prepare / apply and its transaction style: video probes outside the write
lock, docs use one write per file with lock retries, zim and archive use
one write per page.  Archive HTML that is not a SingleFile raises
SkipModeler so apply_indexers can claim it.

* files: quieter batch-modeler errors; drop unused imports

Break out of a batch page on InvalidRequestError after a flush failure
so the rest of the page does not each log the same poisoned session.
Re-raise PYTEST apply failures without a misleading commit-failure
message.  Remove asyncio/List/OperationalError/PYTEST/Iterable leftovers
from docs, archive, and zim.
This commit is contained in:
lrnselfreliance 2026-09-24 16:47:31 -06:00 • committed by Roland
parent 2d0f433450
commit 92fa3f785f
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
9 changed files with 443 additions and 279 deletions

View file

@ -167,7 +167,7 @@ async def test_doc_modeler_terminates_on_persistent_failure(async_client, test_s
# PYTEST re-raises inside the loop's per-item handler; disable that so we exercise the failure
# path and the loop's termination guard, not the re-raise.
with patch('modules.docs._model_doc', side_effect=RuntimeError('boom')), \
patch('modules.docs.PYTEST', False):
patch('wrolpi.files.modeler.PYTEST', False):
await asyncio.wait_for(doc_modeler(), timeout=10)
# No Doc rows were created (every attempt failed), but the loop still terminated.