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:42:10 +08:00 committed by GitHub
parent 8c2d3952c0
commit a70badff6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,6 +78,8 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
// Add timeout to prevent indefinite hanging
const controller = new AbortController()
let embeddingTimeoutId = undefined
// If embeddingTimeoutMs <= 0, the timeout is disabled and requests may hang indefinitely.
// To enable the timeout, set embeddingTimeoutMs to a positive integer (milliseconds).
if (this.embeddingTimeoutMs > 0) {
embeddingTimeoutId = setTimeout(() => controller.abort(), this.embeddingTimeoutMs)
}