Skip to content

Commit

Permalink
ENH: Warn about messages with duplicate message numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Feb 6, 2024
1 parent 2e6c23f commit 41c5b11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions octue/cloud/pub_sub/message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ def _extract_and_enqueue_event(self, message):
self._child_sdk_version = attributes["version"]

message_number = attributes["message_number"]

if message_number in self.waiting_messages:
logger.warning(
"%r: Message with duplicate message number %d received for question %s - overwriting original message.",
self.receiving_service,
message_number,
self.question_uuid,
)

self.waiting_messages[message_number] = event

def _attempt_to_handle_waiting_messages(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "octue"
version = "0.52.0"
version = "0.52.1"
description = "A package providing template applications for data services, and a python SDK to the Octue API."
readme = "README.md"
authors = ["Marcus Lugg <[email protected]>", "Thomas Clark <[email protected]>"]
Expand Down

0 comments on commit 41c5b11

Please sign in to comment.