diff --git a/source/config/tasks.py b/source/config/tasks.py index 65d8044..0b3068f 100644 --- a/source/config/tasks.py +++ b/source/config/tasks.py @@ -24,6 +24,11 @@ def scrape_srs_server(node: SRSNode): streamobjs = [] for streamjson in streams: + # if there are consumers still connected to a stream, the stream will stay listed, + # but the publish status will be false. we do not care about such (dead) streams. + active = streamjson.get('publish', {}).get('active', False) + if not active: + continue # find the corresponding stream object by comparing the stream uuid stream = Stream.objects.get(stream=streamjson.get('name')) streaminstance, _ = SRSStreamInstance.objects.get_or_create(stream=stream, node=node)