Allow changing the POOL_SIZE and MAX_OVERFLOW config values of the pgAdmin config DB connection pool. #6208

This commit is contained in:
Yogesh Mahajan 2023-08-16 15:29:11 +05:30 committed by GitHub
parent 33b2b82ba9
commit 34f160cec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -22,6 +22,13 @@ root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)
# The config database connection pool size.
# Setting this to 0 will remove any limit.
CONFIG_DATABASE_CONNECTION_POOL_SIZE = 5
# The number of connections allowed to overflow beyond
# the connection pool size.
CONFIG_DATABASE_CONNECTION_MAX_OVERFLOW = 100
from pgadmin.utils import env, IS_WIN, fs_short_path
##########################################################################

View File

@ -23,7 +23,7 @@ from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.mutable import MutableDict
import sqlalchemy.types as types
import uuid
import json
import config
##########################################################################
#
@ -41,7 +41,12 @@ SCHEMA_VERSION = 35
#
##########################################################################
db = SQLAlchemy()
db = SQLAlchemy(
engine_options={
'pool_size': config.CONFIG_DATABASE_CONNECTION_POOL_SIZE,
'max_overflow': config.CONFIG_DATABASE_CONNECTION_MAX_OVERFLOW})
USER_ID = 'user.id'
SERVER_ID = 'server.id'

View File

@ -49,9 +49,8 @@ root = os.path.dirname(CURRENT_PATH)
if sys.path[0] != root:
sys.path.insert(0, root)
os.chdir(root)
from pgadmin import create_app
import config
from pgadmin import create_app
if config.SERVER_MODE is True:
config.SECURITY_RECOVERABLE = True