Commit 78440a42 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Simap Connector:

- Disabled read timeout in collector worker
- Fixed wrong symbol parsing reply
parent 5768de72
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ class CollectorWorker(_Worker):
            try:
                # NOTE: Trick: we set 1-second read_timeout to force the loop to give control
                # back and be able to check termination events.
                with session.get(stream_url, stream=True, timeout=(10, 1)) as reply:
                # , timeout=(10, 1)
                with session.get(stream_url, stream=True) as reply:
                    reply.raise_for_status()

                    it_lines = reply.iter_lines(decode_unicode=True, chunk_size=1024)
@@ -75,7 +76,7 @@ class CollectorWorker(_Worker):

                        self._logger.info('[run] ==> {:s}'.format(str(line)))
                        if not line.startswith('data:'): continue
                        data = json.loads(data[5:])
                        data = json.loads(line[5:])

                        if 'notification' not in data:
                            MSG = 'Field(notification) missing: {:s}'