docs: add commet to warn disabled timeout

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
神楽坂·喵 2025-12-06 15:46:41 +08:00 committed by GitHub
parent a70badff6b
commit 408559ad16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -266,6 +266,7 @@ const ollamaSchema = baseProviderSettingsSchema.extend({
ollamaBaseUrl: z.string().optional(),
ollamaApiKey: z.string().optional(),
ollamaEmbeddingTimeoutMs: z.number().int().optional(),
// Negative values disable the validation timeout. If set to a positive integer, it specifies the timeout in milliseconds.
ollamaValidationTimeoutMs: z.number().int().optional(),
ollamaNumCtx: z.number().int().min(128).optional(),
})

View file

@ -222,6 +222,8 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
// Add timeout for test request too
const testController = new AbortController()
let testTimeoutId = undefined
// If validationTimeoutMs is <= 0, the timeout is disabled (no abort will be triggered).
// Set validationTimeoutMs to a positive integer (milliseconds) to enable the timeout.
if (this.validationTimeoutMs > 0) {
testTimeoutId = setTimeout(() => testController.abort(), this.validationTimeoutMs)
}