Merge branch 'master' into otp-rework
# Conflicts: # passbook/flows/models.py # passbook/stages/otp/models.py # swagger.yaml
This commit is contained in:
@ -13,6 +13,7 @@ def delete_cache_prefix(prefix: str) -> int:
|
||||
cache.delete_many(keys)
|
||||
return len(keys)
|
||||
|
||||
|
||||
@receiver(post_save)
|
||||
# pylint: disable=unused-argument
|
||||
def invalidate_flow_cache(sender, instance, **_):
|
||||
@ -25,7 +26,9 @@ def invalidate_flow_cache(sender, instance, **_):
|
||||
LOGGER.debug("Invalidating Flow cache", flow=instance, len=total)
|
||||
if isinstance(instance, FlowStageBinding):
|
||||
total = delete_cache_prefix(f"{cache_key(instance.flow)}*")
|
||||
LOGGER.debug("Invalidating Flow cache from FlowStageBinding", binding=instance, len=total)
|
||||
LOGGER.debug(
|
||||
"Invalidating Flow cache from FlowStageBinding", binding=instance, len=total
|
||||
)
|
||||
if isinstance(instance, Stage):
|
||||
total = 0
|
||||
for binding in FlowStageBinding.objects.filter(stage=instance):
|
||||
|
||||
Reference in New Issue
Block a user