Configure link fetch to use prefetchTimeout

This change modifies the `fetch` function in `link.js` to use the new `prefetchTimeout` config setting introduced in the previous commit. This allows configuring the length of the timeout.

I've added a comment here to indicate milliseconds are the unit in use, since otherwise that would no longer be obvious from the code without looking at the default value (which could change).
This commit is contained in:
Emily Strickland 2022-04-08 15:45:37 -07:00 committed by Emily Strickland
parent 3202b79990
commit 3796485217
No known key found for this signature in database
GPG key ID: 6526B8035DD3DD32

View file

@ -390,7 +390,7 @@ function fetch(uri, headers) {
try {
const gotStream = got.stream(uri, {
retry: 0,
timeout: 5000,
timeout: Helper.config.prefetchTimeout, // milliseconds
headers: getRequestHeaders(headers),
https: {
rejectUnauthorized: false,