Allow changing the POOL_SIZE and MAX_OVERFLOW config values of the pgAdmin config DB connection pool. #6208
parent
33b2b82ba9
commit
34f160cec7
|
@ -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
|
||||
|
||||
##########################################################################
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue