Skip to content

Commit

Permalink
Update NeonMQHandler import path
Browse files Browse the repository at this point in the history
Refactor shutdown to ensure MQ client connections are closed
  • Loading branch information
NeonDaniel committed Jan 13, 2025
1 parent 3f4e5d1 commit 777bb0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion neon_iris/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from pika.exceptions import StreamLostError
from neon_utils.configuration_utils import get_neon_user_config
from neon_utils.metrics_utils import Stopwatch
from neon_utils.mq_utils import NeonMQHandler
from neon_mq_connector.utils.client_utils import NeonMQHandler
from neon_utils.socket_utils import b64_to_dict
from neon_utils.file_utils import decode_base64_string_to_file, \
encode_file_to_base64_string
Expand Down Expand Up @@ -130,6 +130,9 @@ def shutdown(self):
"""
try:
self._connection.stop()
# TODO: This is patching bad behavior in upstream neon_mq_connector
if self._connection.connection.is_open:
self._connection.connection.close()
except Exception as e:
LOG.error(e)
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import sys
import unittest

from neon_utils.mq_utils import NeonMQHandler
from neon_mq_connector.utils.client_utils import NeonMQHandler

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from neon_iris.client import NeonAIClient
Expand Down

0 comments on commit 777bb0b

Please sign in to comment.