diff --git a/services/feed-requests/package-lock.json b/services/feed-requests/package-lock.json index a1cecdea5..cd2afeac8 100644 --- a/services/feed-requests/package-lock.json +++ b/services/feed-requests/package-lock.json @@ -35,7 +35,8 @@ "redis": "^4.6.7", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", - "rxjs": "^7.2.0" + "rxjs": "^7.2.0", + "undici": "^6.5.0" }, "devDependencies": { "@mikro-orm/cli": "^5.7.5", @@ -2187,6 +2188,14 @@ "fast-uri": "^2.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", + "engines": { + "node": ">=14" + } + }, "node_modules/@fastify/compress": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/@fastify/compress/-/compress-6.4.0.tgz", @@ -12021,6 +12030,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/undici": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.5.0.tgz", + "integrity": "sha512-/MUmPb2ptTvp1j7lPvdMSofMdqPxcOhAaKZi4k55sqm6XMeKI3n1dZJ5cnD4gLjpt2l7CIlthR1IXM59xKhpxw==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=18.0" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -14343,6 +14363,11 @@ "fast-uri": "^2.0.0" } }, + "@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==" + }, "@fastify/compress": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/@fastify/compress/-/compress-6.4.0.tgz", @@ -21679,6 +21704,14 @@ } } }, + "undici": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.5.0.tgz", + "integrity": "sha512-/MUmPb2ptTvp1j7lPvdMSofMdqPxcOhAaKZi4k55sqm6XMeKI3n1dZJ5cnD4gLjpt2l7CIlthR1IXM59xKhpxw==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + }, "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/services/feed-requests/package.json b/services/feed-requests/package.json index 49adbed32..68e48a3bb 100644 --- a/services/feed-requests/package.json +++ b/services/feed-requests/package.json @@ -54,7 +54,8 @@ "redis": "^4.6.7", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", - "rxjs": "^7.2.0" + "rxjs": "^7.2.0", + "undici": "^6.5.0" }, "devDependencies": { "@mikro-orm/cli": "^5.7.5", diff --git a/services/feed-requests/src/config/index.ts b/services/feed-requests/src/config/index.ts index 9fdcfb5e2..69d98d515 100644 --- a/services/feed-requests/src/config/index.ts +++ b/services/feed-requests/src/config/index.ts @@ -2,6 +2,7 @@ import dotenv from 'dotenv'; import path from 'path'; import { testConfig } from './test.config'; import { Environment, EnvironmentVariables, validateConfig } from './validate'; +import { setGlobalDispatcher, Agent } from 'undici'; const envFiles: Record = { development: '.env.development', @@ -54,6 +55,12 @@ export default function config(): EnvironmentVariables { ), }; + setGlobalDispatcher( + new Agent({ + connect: { timeout: values.FEED_REQUESTS_REQUEST_TIMEOUT_MS }, + }), + ); + validateConfig(values); return values;