From 8d77903edfeedb4b453af34471e6dcd9c905d116 Mon Sep 17 00:00:00 2001 From: Tristan Date: Thu, 7 Dec 2023 20:52:46 +0000 Subject: [PATCH] Add DB_MAX_CONNECTIONS env variable --- modules/main_index/.env_sample | 1 + modules/main_index/index.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/main_index/.env_sample b/modules/main_index/.env_sample index 5f212ca..3c7d852 100644 --- a/modules/main_index/.env_sample +++ b/modules/main_index/.env_sample @@ -5,6 +5,7 @@ DB_PORT="5432" DB_DATABASE="postgres_metaprotocol" DB_PASSWD="" DB_SSL="true" +DB_MAX_CONNECTIONS=200 BITCOIN_CHAIN_FOLDER="~/.bitcoin/" ORD_BINARY="ord" diff --git a/modules/main_index/index.js b/modules/main_index/index.js index 97fa7bb..5b2df5d 100644 --- a/modules/main_index/index.js +++ b/modules/main_index/index.js @@ -27,7 +27,7 @@ var db_pool = new Pool({ database: process.env.DB_DATABASE || 'postgres', password: process.env.DB_PASSWD, port: parseInt(process.env.DB_PORT || "5432"), - max: 200, // maximum number of clients!! + max: process.env.DB_MAX_CONNECTIONS || 200, // maximum number of clients!! ssl: process.env.DB_SSL == 'true' ? true : false })