Skip to content

Commit

Permalink
GH #755 - Set the database timeout in Dashboard to 30 seconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuch committed Dec 8, 2023
1 parent c6ebfc6 commit 0129e0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/zato-cli/src/zato/cli/create_web_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"DATABASE_PASSWORD": "{DATABASE_PASSWORD}",
"DATABASE_HOST": "{DATABASE_HOST}",
"DATABASE_PORT": "{DATABASE_PORT}",
"DATABASE_OPTIONS": {"timeout": 30},
"TIME_ZONE": "America/New_York",
"LANGUAGE_CODE": "en-us",
Expand Down
2 changes: 1 addition & 1 deletion code/zato-web-admin/src/zato/admin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
db_data = DATABASES['default']
db_data['ENGINE'] = 'django.db.backends.' + django_sqlalchemy_engine[db_type]

for name in('ENGINE', 'NAME', 'USER', 'PASSWORD', 'HOST', 'PORT'):
for name in('ENGINE', 'NAME', 'USER', 'PASSWORD', 'HOST', 'PORT', 'OPTIONS'):
globals()['DATABASE_{}'.format(name)] = DATABASES['default'][name]

db_data['db_type'] = db_type
Expand Down
3 changes: 2 additions & 1 deletion code/zato-web-admin/src/zato/admin/zato_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def update_globals(config, base_dir='.', needs_crypto=True):
k = k.replace('DATABASE_', '', 1)
if k == 'PASSWORD' and config['db_type'] != 'sqlite':
v = cm.decrypt(v)
default[k] = str(v)
v = str(v) if k != 'OPTIONS' else v
default[k] = v
else:
if k == 'ADMIN_INVOKE_PASSWORD' and needs_crypto:
v = cm.decrypt(v)
Expand Down

0 comments on commit 0129e0b

Please sign in to comment.