From 8c2d3952c04d6ef3474cb28f2b06615d98ceae38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=C2=B7=E5=96=B5?= Date: Sat, 6 Dec 2025 15:31:06 +0800 Subject: [PATCH] fix: prevents passing 0 as a valid timeout value Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> --- src/services/code-index/embedders/ollama.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/code-index/embedders/ollama.ts b/src/services/code-index/embedders/ollama.ts index cd318c6115..b611c55d71 100644 --- a/src/services/code-index/embedders/ollama.ts +++ b/src/services/code-index/embedders/ollama.ts @@ -32,8 +32,8 @@ export class CodeIndexOllamaEmbedder implements IEmbedder { this.baseUrl = baseUrl this.modelId = options.ollamaModelId || OLLAMA_DEFAULT_MODEL_ID - this.embeddingTimeoutMs = options.ollamaEmbeddingTimeoutMs || OLLAMA_EMBEDDING_TIMEOUT_MS - this.validationTimeoutMs = options.ollamaValidationTimeoutMs || OLLAMA_VALIDATION_TIMEOUT_MS + this.embeddingTimeoutMs = options.ollamaEmbeddingTimeoutMs ?? OLLAMA_EMBEDDING_TIMEOUT_MS + this.validationTimeoutMs = options.ollamaValidationTimeoutMs ?? OLLAMA_VALIDATION_TIMEOUT_MS } /**