From 26780d2593c677fdfaae3baa3937369f730b17b4 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 30 Jan 2021 12:30:10 +0000 Subject: [PATCH] Add bugfixes to bridge.py --- bridge.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bridge.py b/bridge.py index 0813ec9..48a3487 100755 --- a/bridge.py +++ b/bridge.py @@ -180,8 +180,13 @@ 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: + logger.debug("(%s) Keyerror - stream trimmer Stream ID: %s Start: %s Contention: %s RFS: %s TGID: %s",stream_id,systems[system].STATUS[stream_id]['START'],systems[system].STATUS[stream_id]['CONTENTION'],systems[system].STATUS[stream_id]['RFS'],int_id(systems[system].STATUS[stream_id]['TGID'])) + systems[system].STATUS[stream_id]['LAST'] = _now + continue for stream_id in remove_list: if stream_id in systems[system].STATUS: _stream = systems[system].STATUS[stream_id]