mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-06-05 03:16:29 +00:00
fix: add timeout to fetch to prevent silent hangs
Add AbortSignal.timeout(30s) to fetch requests to ensure they fail fast instead of hanging indefinitely when network issues occur. This fixes issues where the action would hang and eventually get killed by GitHub Actions without a clear error message.
This commit is contained in:
committed by
Kevin Stillhammer
parent
e7108c6ccc
commit
edc4037b1b
14
dist/setup/index.cjs
generated
vendored
14
dist/setup/index.cjs
generated
vendored
@@ -95790,10 +95790,16 @@ function getProxyAgent() {
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
var fetch = async (url2, opts) => await (0, import_undici2.fetch)(url2, {
|
||||
dispatcher: getProxyAgent(),
|
||||
...opts
|
||||
});
|
||||
var fetch = async (url2, opts) => {
|
||||
const timeoutSignal = AbortSignal.timeout(3e4);
|
||||
const existingSignal = opts.signal;
|
||||
const mergedSignal = existingSignal ? AbortSignal.any([timeoutSignal, existingSignal]) : timeoutSignal;
|
||||
return await (0, import_undici2.fetch)(url2, {
|
||||
dispatcher: getProxyAgent(),
|
||||
...opts,
|
||||
signal: mergedSignal
|
||||
});
|
||||
};
|
||||
|
||||
// src/download/variant-selection.ts
|
||||
function selectDefaultVariant(entries, duplicateEntryDescription) {
|
||||
|
||||
14
dist/update-known-checksums/index.cjs
generated
vendored
14
dist/update-known-checksums/index.cjs
generated
vendored
@@ -49749,10 +49749,16 @@ function getProxyAgent() {
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
var fetch = async (url, opts) => await (0, import_undici2.fetch)(url, {
|
||||
dispatcher: getProxyAgent(),
|
||||
...opts
|
||||
});
|
||||
var fetch = async (url, opts) => {
|
||||
const timeoutSignal = AbortSignal.timeout(3e4);
|
||||
const existingSignal = opts.signal;
|
||||
const mergedSignal = existingSignal ? AbortSignal.any([timeoutSignal, existingSignal]) : timeoutSignal;
|
||||
return await (0, import_undici2.fetch)(url, {
|
||||
dispatcher: getProxyAgent(),
|
||||
...opts,
|
||||
signal: mergedSignal
|
||||
});
|
||||
};
|
||||
|
||||
// src/download/manifest.ts
|
||||
var cachedManifestData = /* @__PURE__ */ new Map();
|
||||
|
||||
Reference in New Issue
Block a user