fetch-retry.js 316 B

1234567891011
  1. // @ts-check
  2. const undici = require('undici');
  3. // Enable HTTP/2 supports
  4. undici.setGlobalDispatcher(new undici.Agent({
  5. allowH2: true,
  6. pipelining: 10
  7. }));
  8. const fetchWithRetry = /** @type {import('undici').fetch} */(require('@vercel/fetch-retry')(undici.fetch));
  9. module.exports.fetchWithRetry = fetchWithRetry;