Last active
March 16, 2016 18:21
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A rather large annoyance in my opinion, if you don't need it, drop it! 😛