From d3856371c9750c5d4aae4f47ef7a35029db1edae Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 12 Oct 2024 19:36:49 -0300 Subject: [PATCH] Update index.ts --- apps/api/src/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 1cdda34e..e2b2d31d 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -20,6 +20,7 @@ import { crawlStatusWSController } from "./controllers/v1/crawl-status-ws"; import { ErrorResponse, ResponseWithSentry } from "./controllers/v1/types"; import { ZodError } from "zod"; import { v4 as uuidv4 } from "uuid"; +import dns from 'node:dns'; const { createBullBoard } = require("@bull-board/api"); const { BullAdapter } = require("@bull-board/api/bullAdapter"); @@ -28,13 +29,14 @@ const { ExpressAdapter } = require("@bull-board/express"); const numCPUs = process.env.ENV === "local" ? 2 : os.cpus().length; Logger.info(`Number of CPUs: ${numCPUs} available`); -const cacheable = new CacheableLookup({ - // this is important to avoid querying local hostnames see https://github.com/szmarczak/cacheable-lookup readme - lookup:false -}); +// Disable CacheableLookup for VPC fire-engine-api +const cacheable = new CacheableLookup() + +// Install cacheable lookup for all other requests cacheable.install(http.globalAgent); -cacheable.install(https.globalAgent) +cacheable.install(https.globalAgent); + const ws = expressWs(express()); const app = ws.app;