gabriel / musehub public
fix patch task/timing-instrumentation #4 / 5
AI Agent gabriel · 35 days ago · May 10, 2026 · Diff

fix: batch enqueue_push_intel from O(N) to O(1) DB round-trips

Phase 10 was adding ~1.4s to every push (18 sequential SELECT+INSERT pairs at ~80ms Docker postgres latency). Replace the per-job loop in enqueue_push_intel with a single SELECT … IN to find already-pending types, then session.add_all for the missing ones — two round-trips total regardless of job count.

Also remove autouse=True from _stub_push_background_tasks so tests declare their dependencies explicitly. test_push_enqueues_intel_jobs now opts in via an explicit fixture parameter; enqueue unit tests call the real implementation and verify DB state directly.

sha256:34844ccdc278ce0371354d4b298302848ce48f8399946af20d41dd7a1ef5d8cd sha
sha256:c10f13af59dea93995b3c8d4410d84b1f42080ffecc98cd6719f07dba3d5dc2b snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:34844ccdc278ce0371354d4b298302848ce48f8399946af20d41dd7a1ef5d8cd --body "your comment"