mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Prevented unlimited memory consumption when running background tasks with DEBUG=True. Thanks Rob, Alex, Baptiste, and others.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user