Commit eb30182c authored by Wout De Nolf's avatar Wout De Nolf
Browse files

10 min data expiration time

parent 7996e5fa
......@@ -21,7 +21,7 @@ class DataPolicyObject:
_REQUIRED_INFO = {"__name__", "__path__"}
_NODE_TYPE = NotImplemented
_NODE_EXPIRATION_TIME = 300 # seconds
DATA_EXPIRATION_TIME = 600 # seconds
def __init__(self, node):
"""
......@@ -247,7 +247,7 @@ class DataPolicyObject:
)
if include_parents:
names |= set(self.node.get_db_names(include_parents=True))
set_expiration_date(names, self._NODE_EXPIRATION_TIME)
set_expiration_date(names, self.DATA_EXPIRATION_TIME)
def remove_expiration_date(self):
"""Includes node and parents nodes. Child nodes are not included.
......
......@@ -331,7 +331,8 @@ class BasicScanSaving(EvalParametersWardrobe):
"data_policy",
]
REDIS_SETTING_PREFIX = "scan_saving"
SLOTS = ["_data_expiration_time"]
SLOTS = []
DATA_EXPIRATION_TIME = 600 # seconds
def __init__(self, name=None):
"""
......@@ -358,7 +359,6 @@ class BasicScanSaving(EvalParametersWardrobe):
The *parent* node should be use as parameters for the Scan.
"""
self._data_expiration_time = 300 # seconds
if not name:
name = str(uuid.uuid4().hex)
super().__init__(
......@@ -737,7 +737,7 @@ class BasicScanSaving(EvalParametersWardrobe):
"""Set the expiration date of all Redis keys
"""
set_expiration_date(
itertools.chain(scan_keys, parent_keys), self._data_expiration_time
itertools.chain(scan_keys, parent_keys), self.DATA_EXPIRATION_TIME
)
......@@ -1607,4 +1607,4 @@ class ESRFScanSaving(BasicScanSaving):
def set_expiration_date(self, scan_keys, _):
"""Set the expiration date of the Redis keys of the scan only
"""
set_expiration_date(scan_keys, self._data_expiration_time)
set_expiration_date(scan_keys, self.DATA_EXPIRATION_TIME)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment