Commit 394bcb5d authored by juga's avatar juga
Browse files

Warn when started_at does not exists

parent 9fa3d173
......@@ -110,9 +110,13 @@ def read_started_ts(conf):
:returns: str, ISO formated timestamp
"""
filepath = conf['paths']['started_filepath']
with FileLock(filepath):
with open(filepath, 'r') as fd:
generator_started = fd.read()
try:
with FileLock(filepath):
with open(filepath, 'r') as fd:
generator_started = fd.read()
except FileNotFoundError as e:
log.warn('File %s not found.%s', filepath, e)
return ''
return generator_started
......
Supports Markdown
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