From ecb1aaf5b51554fb8bc79c1999e87f7ac2152176 Mon Sep 17 00:00:00 2001 From: meeb Date: Tue, 21 Sep 2021 23:11:31 +1000 Subject: [PATCH] disable hacky db connection keep-alive for postgresql, resolves #135 --- tubesync/tubesync/dbutils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tubesync/tubesync/dbutils.py b/tubesync/tubesync/dbutils.py index e04200c..271e100 100644 --- a/tubesync/tubesync/dbutils.py +++ b/tubesync/tubesync/dbutils.py @@ -5,6 +5,11 @@ from django.db.backends.utils import CursorWrapper def patch_ensure_connection(): for name, config in settings.DATABASES.items(): + + # Don't patch for PostgreSQL, it doesn't need it and can cause issues + if config['ENGINE'] == 'django.db.backends.postgresql': + continue + module = importlib.import_module(config['ENGINE'] + '.base') def ensure_connection(self):