From 77cd00ad13d4346e365c7be60037f3e13b681b28 Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Thu, 7 Nov 2024 01:49:18 -0500 Subject: [PATCH] fix(core): update socket timeout --- core/api/src/servers/exporter.ts | 2 +- core/api/src/services/mongodb/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/api/src/servers/exporter.ts b/core/api/src/servers/exporter.ts index 963632b127..1a8b8142cc 100644 --- a/core/api/src/servers/exporter.ts +++ b/core/api/src/servers/exporter.ts @@ -213,7 +213,7 @@ const main = async () => { setupMongoConnection({ syncIndexes: false, - options: { readPreference: "secondaryPreferred", socketTimeoutMS: 120000 }, + options: { readPreference: "secondaryPreferred", socketTimeoutMS: 150000 }, }) .then(() => main()) .catch((err) => logger.error(err)) diff --git a/core/api/src/services/mongodb/index.ts b/core/api/src/services/mongodb/index.ts index 4a6c01df47..dbc8ee99df 100644 --- a/core/api/src/services/mongodb/index.ts +++ b/core/api/src/services/mongodb/index.ts @@ -30,7 +30,7 @@ const DEFAULT_MONGODB_OPTIONS: mongoose.ConnectOptions = { minPoolSize: 15, maxConnecting: 5, // Maximum number of concurrent connection attempts - socketTimeoutMS: 60000, // Close sockets after 60 seconds of inactivity + socketTimeoutMS: 120000, // Close sockets after 120 seconds of inactivity connectTimeoutMS: 15000, // Give up initial connection after 15 seconds serverSelectionTimeoutMS: 15000, // Keep trying to send operations for 15 seconds