Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Orru <simone.orru@secomind.com>
  • Loading branch information
sorru94 committed Nov 7, 2024
1 parent 8797249 commit 8c12862
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests-grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
python-version: ["3.12"]
msghub-version: ["v0.6.1"]
msghub-version: ["v0.7.0"]
concurrency:
group: e2e-test-grpc-${{ matrix.python-version }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
24 changes: 11 additions & 13 deletions astarte/device/device_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,18 +249,16 @@ def _rx_stream_handler(self):
try:
for msg_hub_event in stream:
astarte_message = _decode_msg_hub_event(msg_hub_event)
if not astarte_message:
continue

(interface_name, path, payload) = astarte_message
logging.debug(
"Received message on interface: %s, endpoint %s, content: %s",
str(interface_name),
str(path),
str(payload),
)
if self._on_data_received:
self._on_message_generic(interface_name, path, payload)
if astarte_message:
(interface_name, path, payload) = astarte_message
logging.debug(
"Received message on interface: %s, endpoint %s, content: %s",
str(interface_name),
str(path),
str(payload),
)
if self._on_data_received:
self._on_message_generic(interface_name, path, payload)
except _MultiThreadedRendezvous as exc:
logging.error("Status code change in the GRPC core: %s", str(exc.code()))

Expand Down Expand Up @@ -514,7 +512,7 @@ def _decode_msg_hub_event(

payload = None
if msg_hub_event.HasField("error"):
logging.error(f"Error from the message hub: {msg_hub_event.error.description}")
logging.error("Error from the message hub: %s", msg_hub_event.error.description)
else:
payload = _decode_astarte_message(msg_hub_event.message)

Expand Down

0 comments on commit 8c12862

Please sign in to comment.