#NEWLINE# def process_response( self , request , response ) : #NEWLINE# #INDENT# '\n        If there was a write to the db, set the session variable to enable\n        pinning.  If the variable already exists, the time will be reset.\n        ' #NEWLINE# if pinning . db_was_written ( ) : #NEWLINE# #INDENT# pinned_until = ( datetime . now ( ) + timedelta ( seconds = PINNING_SECONDS ) ) #NEWLINE# request . session [ PINNING_KEY ] = pinned_until #NEWLINE# pinning . clear_db_write ( ) #NEWLINE# #UNINDENT# pinning . unpin_thread ( ) #NEWLINE# return response