From dd8b0ebdf2744a02e2b6a04338ae508f672f709c Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 25 Mar 2021 23:02:17 +0000 Subject: [PATCH] remove fin list --- bridge_master.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index 4a06a99..dbadd0a 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -383,8 +383,7 @@ def stream_trimmer_loop(): #if stream already marked as finished, just remove it if '_fin' in systems[system].STATUS[stream_id] and systems[system].STATUS[stream_id]['LAST'] < _now - 5: - removed = systems[system].STATUS.pop(stream_id) - continue + fin_list.append(stream_id) try: if systems[system].STATUS[stream_id]['LAST'] < _now - 5: @@ -394,6 +393,10 @@ def stream_trimmer_loop(): systems[system].STATUS[stream_id]['LAST'] = _now continue + #remove finished + for stream_id in fin_list: + removed = systems[system].STATUS.pop(stream_id) + for stream_id in remove_list: if stream_id in systems[system].STATUS: _stream = systems[system].STATUS[stream_id]