summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvo Polizzi <101474753+salvo-polizzi@users.noreply.github.com>2024-01-22 13:31:50 +0100
committerGitHub <noreply@github.com>2024-01-22 13:31:50 +0100
commit184d82d8488b1b31ade5b5a68b0040f1c267f2be (patch)
treeefe0159e904f455547b69d046284536fdc6fce86
parent1c3a9b9f968295848baa56670797fb424096efaf (diff)
Fixed #35130 -- Doc'd django.db.close_old_connections().
This also adds close_db_connections() to the django.db.__all__.
-rw-r--r--django/db/__init__.py1
-rw-r--r--docs/ref/databases.txt3
2 files changed, 3 insertions, 1 deletions
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
--------