diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-03-18 14:55:33 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-06-17 13:21:27 +0200 |
commit | e50b4030deb722c3c7d2ba79a7b7d0545ccd24f8 (patch) | |
tree | ce5a30cf06d8128d9178b61e6d43fd06669667bb /ishtar_common/utils.py | |
parent | 5b4c4f8c0637918356b3942f86be9dbc39efbbe4 (diff) | |
download | Ishtar-e50b4030deb722c3c7d2ba79a7b7d0545ccd24f8.tar.bz2 Ishtar-e50b4030deb722c3c7d2ba79a7b7d0545ccd24f8.zip |
Option to disable TASK TIMEOUT (and disable it for tests)
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |