From f05d192a1bfee3e57ebd0017990aa49b510cb21b Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 17 Jan 2021 22:45:45 +0000 Subject: [PATCH] Handle keyerror in stream trimmer --- bridge_master.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index b229964..b77ad3d 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -406,8 +406,12 @@ def stream_trimmer_loop(): if CONFIG['SYSTEMS'][system]['MODE'] == 'OPENBRIDGE': remove_list = [] for stream_id in systems[system].STATUS: - if systems[system].STATUS[stream_id]['LAST'] < _now - 5: - remove_list.append(stream_id) + try: + if systems[system].STATUS[stream_id]['LAST'] < _now - 5: + remove_list.append(stream_id) + except 'KeyError': + logger.debug("Keyerror - stream trimmer") + continue for stream_id in remove_list: if stream_id in systems[system].STATUS: _stream = systems[system].STATUS[stream_id]