Skip to content

Commit d6ca6aa

Browse files
committed
Revert "caching invalidation logic: default 180s, if intend to be invariant, specify as -1 explicitly in config.yml"
This reverts commit eb4f0e5.
1 parent 20c5025 commit d6ca6aa

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

workflowwebtools/default/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ cluster:
7878
midpoint: 50
7979
# Refresh cached jsons in WorkflowWebTools.workflowinfo jsons
8080
# This is maximum age in seconds
81-
# If you want a cache invariant, specify it with -1 explicitly,
82-
# otherwise the default invalidation period is 180s.
8381
cache_refresh:
8482
errors: 345600
85-
workflow_params: -1
8683
workspace: '.'
8784
refresh_period: 15

workflowwebtools/workflowinfo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from . import serverconfig
2121

22-
def cached_json(attribute, timeout=180):
22+
def cached_json(attribute, timeout=None):
2323
"""
2424
A decorator for caching dictionaries in local files.
2525
@@ -47,8 +47,7 @@ def function_wrapper(self, *args, **kwargs):
4747
:returns: Output of the originally decorated function
4848
:rtype: dict
4949
"""
50-
tmout = serverconfig.config_dict()['cache_refresh'].get(attribute) or timeout
51-
if tmout == -1: tmout = None
50+
tmout = timeout or serverconfig.config_dict()['cache_refresh'].get(attribute)
5251

5352
if not os.path.exists(self.cache_dir):
5453
os.mkdir(self.cache_dir)

0 commit comments

Comments
 (0)