We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b48571 commit a5d8a30Copy full SHA for a5d8a30
django_mongodb_backend/base.py
@@ -165,6 +165,10 @@ def get_connection_params(self):
165
settings_dict = self.settings_dict
166
if not settings_dict["NAME"]:
167
raise ImproperlyConfigured('settings.DATABASES is missing the "NAME" value.')
168
+ # Use persistent connections by default, even if the user specifies
169
+ # CONN_MAX_AGE=0. (This code has no way to distinguish that case.)
170
+ if settings_dict["CONN_MAX_AGE"] == 0:
171
+ settings_dict["CONN_MAX_AGE"] = None
172
return {
173
"host": settings_dict["HOST"] or None,
174
"port": int(settings_dict["PORT"] or 27017),
0 commit comments