From 184d82d8488b1b31ade5b5a68b0040f1c267f2be Mon Sep 17 00:00:00 2001 From: Salvo Polizzi <101474753+salvo-polizzi@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:31:50 +0100 Subject: [PATCH] Fixed #35130 -- Doc'd django.db.close_old_connections(). This also adds close_db_connections() to the django.db.__all__. --- django/db/__init__.py | 1 + docs/ref/databases.txt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/django/db/__init__.py b/django/db/__init__.py index f3cf4574a9..eb8118adb5 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -17,6 +17,7 @@ from django.db.utils import ( from django.utils.connection import ConnectionProxy __all__ = [ + "close_old_connections", "connection", "connections", "router", diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 5a31ceeaae..d98d523db5 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -99,7 +99,8 @@ connections. If a connection is created in a long-running process, outside of Django’s request-response cycle, the connection will remain open until explicitly -closed, or timeout occurs. +closed, or timeout occurs. You can use ``django.db.close_old_connections()`` to +close all old or unusable connections. Encoding --------