def commit_veto(request, response): # The default vetoes on response status != 2xx vetoed = default_commit_veto(request, response) if not vetoed and request.method in ('GET', 'POST', 'PUT', 'DELETE'): # we abuse the commit_veto call (called at the end of each request by # the pyramid transaction manager) # to also commit to solr request.solr.commit(soft_commit=OPTIMIZATION_SOFT_COMMIT) return vetoed
def _callFUT(self, response, request=None): from pyramid_tm import default_commit_veto return default_commit_veto(request, response)