Tombstone add exception handler

pull/1300/head
Willem Melching 5 years ago
parent ca2d9af954
commit c495b2d9be
  1. 8
      selfdrive/tombstoned.py

@ -22,6 +22,7 @@ def report_tombstone(fn, client):
f_size = os.path.getsize(fn) f_size = os.path.getsize(fn)
if f_size > MAX_SIZE: if f_size > MAX_SIZE:
cloudlog.error(f"Tombstone {fn} too big, {f_size}. Skipping...") cloudlog.error(f"Tombstone {fn} too big, {f_size}. Skipping...")
return
with open(fn, encoding='ISO-8859-1') as f: with open(fn, encoding='ISO-8859-1') as f:
contents = f.read() contents = f.read()
@ -56,8 +57,11 @@ def main():
now_tombstones = set(get_tombstones()) now_tombstones = set(get_tombstones())
for fn, ctime in (now_tombstones - initial_tombstones): for fn, ctime in (now_tombstones - initial_tombstones):
cloudlog.info(f"reporting new tombstone {fn}") try:
report_tombstone(fn, client) cloudlog.info(f"reporting new tombstone {fn}")
report_tombstone(fn, client)
except Exception:
cloudlog.exception(f"Error reporting tombstone {fn}")
initial_tombstones = now_tombstones initial_tombstones = now_tombstones
time.sleep(5) time.sleep(5)

Loading…
Cancel
Save