Skip to content

Commit

Permalink
Handle empty link_connection_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
congwang09 committed Sep 19, 2023
1 parent 0e5ea90 commit 63ab0ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion swagger_server/handlers/connection_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ def handle_link_failure(self, msg_json):
"link_connections_dict"
)

if not link_connections_dict_str:
if (
not link_connections_dict_str
or not link_connections_dict_str["link_connections_dict"]
):
logger.debug("No connection has been placed yet.")
return

Expand Down
8 changes: 3 additions & 5 deletions swagger_server/messaging/rpc_queue_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ def start_sdx_consumer(self, thread_queue, db_instance):
logger.info("got message from MQ: " + str(msg))
else:
db_instance.add_key_value_pair_to_db(str(MESSAGE_ID), msg)
logger.debug("Save to database complete.")
logger.debug("message ID:" + str(MESSAGE_ID))
value = db_instance.read_from_db(str(MESSAGE_ID))
logger.debug("got value from DB:")
logger.debug(value)
logger.debug(
"Save to database complete. message ID: " + str(MESSAGE_ID)
)
MESSAGE_ID += 1

0 comments on commit 63ab0ab

Please sign in to comment.