From e50b4030deb722c3c7d2ba79a7b7d0545ccd24f8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 18 Mar 2019 14:55:33 +0100 Subject: Option to disable TASK TIMEOUT (and disable it for tests) --- ishtar_common/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ishtar_common/utils.py') diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 4e5259001..9bd81383f 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -376,7 +376,8 @@ def cached_label_changed(sender, **kwargs): cache_key, value = get_cache( sender, ["cached_label_changed", kwargs['instance'].pk] ) - if value: # multiple request too quick + if value and not settings.DISABLE_TASK_TIMEOUT: + # multiple request too quick return cache.set(cache_key, True, settings.CACHE_TASK_TIMEOUT) @@ -590,7 +591,8 @@ def post_save_geo(sender, **kwargs): return cache_key, value = get_cache( sender, ["post_save_geo", kwargs['instance'].pk]) - if value: # multiple request too quick + if value and not settings.DISABLE_TASK_TIMEOUT: + # multiple request too quick return cache.set(cache_key, True, settings.CACHE_TASK_TIMEOUT) -- cgit v1.2.3