From e5b536c3ce658774f91e1c08007296bd78292f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Thu, 9 Jul 2026 07:57:06 +0400 Subject: [PATCH] =?UTF-8?q?Fix:=20connectionTimeoutMillis=3D5s,=20idleTime?= =?UTF-8?q?outMillis=3D10s=20=E2=80=94=20=D0=BF=D1=83=D0=BB=20=D0=BD=D0=B5?= =?UTF-8?q?=20=D0=B2=D0=B8=D1=81=D0=BD=D0=B5=D1=82.=20=D0=92=D0=B5=D1=80?= =?UTF-8?q?=D1=81=D0=B8=D1=8F=200.1.24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/db.js | 3 ++- v2/src/config/index.js | 2 +- v2/src/db/index.js | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 704aaff..18d15e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.1.23", + "version": "0.1.24", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/src/db.js b/src/db.js index dde7399..879cf71 100644 --- a/src/db.js +++ b/src/db.js @@ -9,7 +9,8 @@ const pool = new Pool({ password: process.env.DB_PASS, ssl: process.env.DB_SSLMODE === 'require' ? { rejectUnauthorized: false } : false, max: 10, - idleTimeoutMillis: 30000, + connectionTimeoutMillis: 5000, + idleTimeoutMillis: 10000, }); pool.on('error', (err) => { diff --git a/v2/src/config/index.js b/v2/src/config/index.js index 14d526e..cc173f3 100644 --- a/v2/src/config/index.js +++ b/v2/src/config/index.js @@ -8,7 +8,7 @@ // ═══════════════════════════════════════════════════════════════════════════════ module.exports = { - version: '0.1.23', + version: '0.1.24', // ── Среда ───────────────────────────────────────────────────────────────── // APP_ENV=test → тестовый стенд (жёлтый баннер в UI, можно включать тестовый API) diff --git a/v2/src/db/index.js b/v2/src/db/index.js index 3383e5e..05d44ff 100644 --- a/v2/src/db/index.js +++ b/v2/src/db/index.js @@ -19,7 +19,8 @@ const pool = new Pool({ password: process.env.DB_PASS || '', ssl: process.env.DB_SSLMODE === 'require' ? { rejectUnauthorized: false } : false, max: 10, - idleTimeoutMillis: 30000, + connectionTimeoutMillis: 5000, // 5 сек на подключение → не виснуть + idleTimeoutMillis: 10000, // 10 сек idle → закрыть }); pool.on('error', (err) => {