Revert "*: use cache.delete_pattern instead of getting keys and deleting them"

This reverts commit ff481ba6e7.

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

# Conflicts:
#	authentik/flows/views/executor.py
#	authentik/policies/signals.py
This commit is contained in:
Jens Langhammer
2021-12-12 20:41:34 +01:00
parent 5ef385f0bb
commit 597ce1eb42
8 changed files with 33 additions and 15 deletions

View File

@ -205,7 +205,8 @@ class FlowExecutorView(APIView):
self._logger.warning(
"f(exec): found incompatible flow plan, invalidating run", exc=exc
)
cache.delete_pattern("flow_*")
keys = cache.keys("flow_*")
cache.delete_many(keys)
return self.stage_invalid()
if not next_binding:
self._logger.debug("f(exec): no more stages, flow is done.")
@ -331,7 +332,8 @@ class FlowExecutorView(APIView):
# from the cache. If there are errors, just delete all cached flows
_ = plan.has_stages
except Exception: # pylint: disable=broad-except
cache.delete_pattern("flow_*")
keys = cache.keys("flow_*")
cache.delete_many(keys)
return self._initiate_plan()
return plan