fix: dispatch periodic BookStack indexing from the scheduler task_map#1570
fix: dispatch periodic BookStack indexing from the scheduler task_map#1570pelazas wants to merge 1 commit into
Conversation
BOOKSTACK_CONNECTOR was missing from check_periodic_schedules' task_map, so connectors with periodic indexing enabled fell through to the "No task found" warning branch every minute and never synced. Fixes MODSetter#891 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@pelazas is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
BookStack connectors with periodic sync enabled never actually sync —
BOOKSTACK_CONNECTORisn't in the scheduler'stask_map, so the sync silently no-ops.Description
The BookStack connect form lets you turn on periodic sync, but
check_periodic_scheduleshas notask_mapentry forBOOKSTACK_CONNECTOR. A due connector falls into the warning branch:That branch also never advances
next_scheduled_at, so the connector stays "due" forever and logs this warning every minute.The fix is two lines: import
index_bookstack_pages_taskand add it totask_map. It takes(connector_id, search_space_id, user_id, start_date, end_date)like the other generically-dispatched tasks (Notion/Confluence/GitHub), so no special handling needed.One note: #891 also mentions Obsidian, but I left that out on purpose — Obsidian moved to push-based indexing via the plugin routes (
index_obsidian_attachment_task), there's no vault-pull task to schedule anymore.Motivation and Context
Enabling periodic sync on BookStack does nothing right now, and the only symptom is a log warning every minute. There was an earlier fix attempt (#893) but it was closed for targeting
mainand never re-raised ondev.FIX #891
Screenshots
N/A — backend scheduler change.
API Changes
Change Type
Testing Performed
Added unit tests in
tests/unit/tasks/celery_tasks/test_schedule_checker_task.pythat run_check_and_trigger_scheduleswith the DB session, Redis lock and Celery.delaymocked:index_bookstack_pages_taskand getsnext_scheduled_atadvanced — this fails ondev(reproduces the exact "No task found" warning) and passes with the fixRun with
cd surfsense_backend && uv run pytest tests/unit/tasks/celery_tasks/test_schedule_checker_task.py. Full unit suite passes (2380 tests), pre-commit hooks clean.I didn't test against a live BookStack instance, but the dispatched task is the same one the manual "index now" route already uses.
Checklist