Skip to content

Instantly share code, notes, and snippets.

@bryanhelmig
Last active March 16, 2016 18:21
Show Gist options
  • Save bryanhelmig/684391b7b80b724b26d3 to your computer and use it in GitHub Desktop.
Save bryanhelmig/684391b7b80b724b26d3 to your computer and use it in GitHub Desktop.
This is how to disable the request_finished signal cache close connection behavior in Django.
class DisconnectCacheCloseSignal(object):
""" Add me to your settings.MIDDLEWARE_CLASSES """
def process_response(self, request, response):
from django.core.cache import caches, close_caches
signals.request_finished.disconnect(caches['default'].close)
signals.request_finished.disconnect(close_caches)
return response
@bryanhelmig
Copy link
Author

A rather large annoyance in my opinion, if you don't need it, drop it! 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment