Skip to content
Snippets Groups Projects
Commit 99dc558e authored by Nikolai.Hartmann's avatar Nikolai.Hartmann
Browse files

catch errors in reporter.py

parent a0b349d3
No related branches found
No related tags found
No related merge requests found
......@@ -146,9 +146,14 @@ for logfile in logfiles:
(datetime.fromtimestamp(start_time), datetime.fromtimestamp(end_time))
)
errors = []
n_touched_files = 0
for filename in files:
last_modification_time = os.stat(filename).st_mtime
try:
last_modification_time = os.stat(filename).st_mtime
except Exception as e:
errors.append((filename, e))
continue
# print(filename, last_modification_time)
if last_modification_time > start_time and last_modification_time < end_time:
get_info(filename)
......@@ -156,6 +161,8 @@ for filename in files:
print("xcache reporter - files touched:", n_touched_files)
print("xcache reporter - got {} reports:".format(len(reports)))
if len(errors) > 0:
print("errors: {}".format(errors))
if len(reports) > 0:
r = requests.post(collector, json=reports)
print('xcache reporter - indexing response:', r.status_code)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment