normalize uri when used as stream identifier
This commit is contained in:
@ -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):
|
||||
|
Reference in New Issue
Block a user