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 { try {
const gotStream = got.stream(uri, { const gotStream = got.stream(uri, {
retry: 0, retry: 0,
timeout: 5000, timeout: Helper.config.prefetchTimeout, // milliseconds
headers: getRequestHeaders(headers), headers: getRequestHeaders(headers),
https: { https: {
rejectUnauthorized: false, rejectUnauthorized: false,