policies: skip cache on debug request

This commit is contained in:
Jens Langhammer 2021-02-08 22:14:23 +01:00
parent e555bdd42b
commit 52016e0806
1 changed files with 3 additions and 2 deletions

View File

@ -103,8 +103,9 @@ class PolicyProcess(PROCESS_CLASS):
# Invert result if policy.negate is set
if self.binding.negate:
policy_result.passing = not policy_result.passing
key = cache_key(self.binding, self.request)
cache.set(key, policy_result)
if not self.request.debug:
key = cache_key(self.binding, self.request)
cache.set(key, policy_result)
LOGGER.debug(
"P_ENG(proc): finished and cached ",
policy=self.binding.policy,