1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #3711, #6734, #12581 -- Bounded connection.queries.

Prevented unlimited memory consumption when running background tasks
with DEBUG=True.

Thanks Rob, Alex, Baptiste, and others.
This commit is contained in:
Aymeric Augustin
2014-06-07 14:09:27 +02:00
parent e2112edd9a
commit cfcca7ccce
8 changed files with 94 additions and 33 deletions

View File

@@ -52,7 +52,7 @@ connection = DefaultConnectionProxy()
# Register an event to reset saved queries when a Django request is started.
def reset_queries(**kwargs):
for conn in connections.all():
conn.queries = []
conn.queries_log.clear()
signals.request_started.connect(reset_queries)