From 6a6e8b1bcc1f9af12594b7c0b5b4899adf4f1dd3 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 26 Feb 2025 10:48:27 +0100 Subject: [PATCH] normalize uri when used as stream identifier --- streams.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/streams.py b/streams.py index c0ff36d..b1dcc1c 100644 --- a/streams.py +++ b/streams.py @@ -78,8 +78,8 @@ class Stream(Base): host, _, port = self.uri.partition(':') # try to convert uri to host name host = short_hostname(host) - self.tags['stream'] = f'{host}:{port}' - print(self.uri, '=', self.tags['stream'], 'connected') + self.uri = self.tags['stream'] = f'{host}:{port}' + print(f'{host}:{port}', '=', self.uri, 'connected') self._buffer = [] self._deadline = INF self._next_connect = 0 @@ -284,7 +284,7 @@ class EventStream: continue device = stream.tags.get('device') events.append(('stream', kwargs.get('instrument', '0'), - {'device': device}, uri, int(time.time()))) + {'device': device}, stream.uri, int(time.time()))) for name, stream in self.streams.items(): try: if stream.get_events(events, maxevents):