def process_response(self, request, response):
        if pinning.db_was_written():
            pinned_until = datetime.now() + timedelta(seconds=PINNING_SECONDS)
            request.session[PINNING_KEY] = pinned_until
            pinning.clear_db_write()
        pinning.unpin_thread()
        return response
If there was a write to the db, set the session variable to enable
dataset/ETHPy150Open michaelhelmick/django-balancer/balancer/middleware.py/PinningSessionMiddleware.process_response