feat(TRUEREF-0022): complete iteration 0 — worker-thread indexing, parallel jobs, SSE progress
- Move IndexingPipeline.run() into Worker Threads via WorkerPool - Add dedicated embedding worker thread with single model instance - Add stage/stageDetail columns to indexing_jobs schema - Create ProgressBroadcaster for SSE channel management - Add SSE endpoints: GET /api/v1/jobs/:id/stream, GET /api/v1/jobs/stream - Replace UI polling with EventSource on repo detail and admin pages - Add concurrency settings UI and API endpoint - Build worker entries separately via esbuild
This commit is contained in:
@@ -5,7 +5,9 @@ import { EmbeddingSettingsDtoMapper } from '$lib/server/mappers/embedding-settin
|
||||
import { EmbeddingSettingsService } from '$lib/server/services/embedding-settings.service.js';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const service = new EmbeddingSettingsService(getClient());
|
||||
const db = getClient();
|
||||
|
||||
const service = new EmbeddingSettingsService(db);
|
||||
const settings = EmbeddingSettingsDtoMapper.toDto(service.getSettings());
|
||||
|
||||
let localProviderAvailable = false;
|
||||
@@ -15,8 +17,30 @@ export const load: PageServerLoad = async () => {
|
||||
localProviderAvailable = false;
|
||||
}
|
||||
|
||||
// Read indexing concurrency setting
|
||||
let indexingConcurrency = 2;
|
||||
const concurrencyRow = db
|
||||
.prepare<[], { value: string }>(
|
||||
"SELECT value FROM settings WHERE key = 'indexing.concurrency'"
|
||||
)
|
||||
.get();
|
||||
|
||||
if (concurrencyRow && concurrencyRow.value) {
|
||||
try {
|
||||
const parsed = JSON.parse(concurrencyRow.value);
|
||||
if (typeof parsed === 'object' && parsed !== null && typeof parsed.value === 'number') {
|
||||
indexingConcurrency = parsed.value;
|
||||
} else if (typeof parsed === 'number') {
|
||||
indexingConcurrency = parsed;
|
||||
}
|
||||
} catch {
|
||||
indexingConcurrency = 2;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
settings,
|
||||
localProviderAvailable
|
||||
localProviderAvailable,
|
||||
indexingConcurrency
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user