fix(pipeline): indexing jobs never started due to missing queue.enqueue() calls
All three trigger-indexing routes were calling service.createIndexingJob() directly which only inserts the DB record but never calls processNext(). Fixed to route through getQueue().enqueue() so the job queue actually picks up and runs the job immediately. Affected routes: - POST /api/v1/libs (autoIndex on add) - POST /api/v1/libs/:id/index - POST /api/v1/libs/:id/versions/:tag/index Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { json } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
import { getClient } from '$lib/server/db/client';
|
||||
import { RepositoryService } from '$lib/server/services/repository.service';
|
||||
import { getQueue } from '$lib/server/pipeline/startup';
|
||||
import { handleServiceError } from '$lib/server/utils/validation';
|
||||
|
||||
function getService() {
|
||||
@@ -55,7 +56,10 @@ export const POST: RequestHandler = async ({ request }) => {
|
||||
|
||||
let jobResponse: { id: string; status: string } | null = null;
|
||||
if (body.autoIndex !== false) {
|
||||
const job = service.createIndexingJob(repo.id);
|
||||
const queue = getQueue();
|
||||
const job = queue
|
||||
? queue.enqueue(repo.id)
|
||||
: service.createIndexingJob(repo.id);
|
||||
jobResponse = { id: job.id, status: job.status };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user