wrolpi/modules/zim
lrnselfreliance 8713a6136b
Reset file worker status when a synchronous refresh is cancelled (#775)
* Reset file worker status when a synchronous refresh is cancelled

refresh_sync runs inside request handlers.  When Sanic cancelled one on
response timeout, the phase flag cleared as its `with` block unwound but
the shared status did not, so the worker reported 'modeling' forever while
nothing ran.  Reset to idle on cancellation.

Deleting outdated Zims also ran the global modelers inside the request,
which is what timed out.  Skip post-processing there and update the
outdated_zims flag directly, the only cleanup step it relied on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* tests: observe the modeling flag in the cancelled refresh_sync test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 11:25:25 -06:00
..
test Reset file worker status when a synchronous refresh is cancelled (#775) 2026-10-04 11:25:25 -06:00
__init__.py Zim/Kiwix (Wikipedia) feature 2023-07-10 21:30:40 -06:00
api.py db: one request-scoped database handle per API request (#773) 2026-10-03 15:42:06 -06:00
conftest.py Using aria2c to download files. Removing custom file download functions. 2025-01-10 11:32:37 -07:00
downloader.py Migrating Kiwix downloaders. 2026-05-07 15:54:53 -06:00
errors.py Adding toggle to Channel page to stop downloading comments for certain channels. 2025-03-01 18:23:29 -07:00
kiwix.py Adding Khan Academy to zim subscriptions. Updating some kiwix catalog sizes. 2025-03-03 16:32:35 -07:00
lib.py Reset file worker status when a synchronous refresh is cancelled (#775) 2026-10-04 11:25:25 -06:00
models.py db: request-path library functions use the request's connection (#774) 2026-10-04 11:05:20 -06:00
schema.py Adding feature which adds toggles to Zim files to enable/disable auto search. 2025-02-02 12:43:04 -07:00