adding timeout (#7128)

pull/7133/head
Spoon 2026-01-06 22:00:34 +01:00 committed by GitHub
parent 7d6ce6fc5e
commit 32e0b612d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ export namespace SystemPrompt {
.then((x) => "Instructions from: " + p + "\n" + x),
)
const foundUrls = urls.map((url) =>
fetch(url)
fetch(url, { signal: AbortSignal.timeout(5000) })
.then((res) => (res.ok ? res.text() : ""))
.catch(() => "")
.then((x) => (x ? "Instructions from: " + url + "\n" + x : "")),