mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Adding the timeout for the connection on the configuration database.
While accessing the configuration database from multiple session, it results in to the error - OperationError, because - sqlite locks all the database, and does not allow to access it simultaneously. We added the timeout to give some time window for accessing it simultaneously.
This commit is contained in:
parent
8cfca280d4
commit
d8cbee3850
@ -160,6 +160,10 @@ SQLITE_PATH = os.path.join(
|
||||
os.path.realpath(os.path.expanduser('~/.pgadmin/')),
|
||||
'pgadmin4.db'
|
||||
)
|
||||
# SQLITE_TIMEOUT will define how long to wait before throwing the error -
|
||||
# OperationError due to database lock.
|
||||
# (Default: 500 milliseconds)
|
||||
SQLITE_TIMEOUT = 500
|
||||
|
||||
##########################################################################
|
||||
# Server-side session storage path
|
||||
|
@ -169,8 +169,9 @@ def create_app(app_name=config.APP_NAME):
|
||||
# Setup authentication
|
||||
##########################################################################
|
||||
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{0}'.format(
|
||||
config.SQLITE_PATH.replace('\\', '/')
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{0}?timeout={1}'.format(
|
||||
config.SQLITE_PATH.replace('\\', '/'),
|
||||
getattr(config, 'SQLITE_TIMEOUT', 500)
|
||||
)
|
||||
|
||||
# Only enable password related functionality in server mode.
|
||||
|
Loading…
Reference in New Issue
Block a user