From 24233506c4dd17a6b41e4a426630d7bff87767eb Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Wed, 4 Sep 2024 12:46:16 +0800 Subject: [PATCH] Import server side cursor setting from .env --- .env.sample | 1 + backend/config/settings.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index 6daa4bf..021b6f6 100644 --- a/.env.sample +++ b/.env.sample @@ -27,6 +27,7 @@ DB_PASSWORD = '' DB_HOST = 'postgres' DB_PORT = '5432' DB_SSL_MODE = 'disable' +DB_DISABLE_SERVER_SIDE_CURSORS = 'False' # If you're using an external connection bouncer (eg. PgBouncer), set this to True # Redis # Used for DB cache and Celery broker diff --git a/backend/config/settings.py b/backend/config/settings.py index c486651..bfd5707 100644 --- a/backend/config/settings.py +++ b/backend/config/settings.py @@ -227,7 +227,7 @@ DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql", # Set to True to avoid issues with pgbouncer when pooling connections - 'DISABLE_SERVER_SIDE_CURSORS': True, + 'DISABLE_SERVER_SIDE_CURSORS': get_secret("DB_DISABLE_SERVER_SIDE_CURSORS"), "NAME": get_secret("DB_DATABASE"), "USER": get_secret("DB_USERNAME"), "PASSWORD": get_secret("DB_PASSWORD"),