fix: disable vector setup when embeddings disabled

This commit is contained in:
“BeeRad”
2026-01-29 21:03:01 +11:00
parent 55d3ffa1f7
commit 104b02b02f
3 changed files with 30 additions and 12 deletions
+7
View File
@@ -16,8 +16,12 @@ export class AutoEmbedQueue {
private readonly lastRunAt = new Map<number, number>();
private readonly maxConcurrent = 1;
private readonly cooldownMs = DEFAULT_COOLDOWN_MS;
private readonly embeddingsDisabled = process.env.DISABLE_EMBEDDINGS === 'true';
enqueue(nodeId: number, task: Omit<AutoEmbedTask, 'nodeId'> = {}): boolean {
if (this.embeddingsDisabled && !task.force) {
return false;
}
const existing = this.pendingTasks.get(nodeId);
if (!existing) {
this.pendingTasks.set(nodeId, { nodeId, ...task });
@@ -73,6 +77,9 @@ export class AutoEmbedQueue {
}
private async executeTask(task: AutoEmbedTask) {
if (this.embeddingsDisabled && !task.force) {
return;
}
const node = await nodeService.getNodeById(task.nodeId);
if (!node) {
console.warn('[AutoEmbedQueue] Node missing, skipping', task.nodeId);