Skip to content

Commit 5cae9c3

Browse files
committed
FIX: Get retry count correctly in flask app
skipci
1 parent 8fa3e68 commit 5cae9c3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

octue/cloud/deployment/google/cloud_run/flask_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _acknowledge_and_drop_redelivered_questions(question_uuid, retry_count):
8383
for question in previous_question_attempts:
8484

8585
# Acknowledge questions that are redelivered to stop further redelivery and redundant processing.
86-
if question["attributes"]["other_attributes"]["retry_count"] == retry_count:
86+
if question["attributes"]["retry_count"] == retry_count:
8787
logger.warning(
8888
"Question %r (retry count %s) has already been received by the service. It will now be acknowledged to "
8989
"prevent further redundant redelivery and dropped.",

tests/cloud/deployment/google/cloud_run/test_flask_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_redelivered_questions_are_acknowledged_and_dropped(self):
122122
patch("octue.configuration.ServiceConfiguration.from_file", return_value=MOCK_CONFIGURATION),
123123
patch(
124124
"octue.cloud.deployment.google.cloud_run.flask_app.get_events",
125-
return_value=[{"attributes": {"other_attributes": {"retry_count": 0}}}],
125+
return_value=[{"attributes": {"retry_count": 0}}],
126126
),
127127
]
128128
)
@@ -157,7 +157,7 @@ def test_retried_questions_are_allowed(self):
157157
patch("octue.configuration.ServiceConfiguration.from_file", return_value=MOCK_CONFIGURATION),
158158
patch(
159159
"octue.cloud.deployment.google.cloud_run.flask_app.get_events",
160-
return_value=[{"attributes": {"other_attributes": {"retry_count": 0}}}],
160+
return_value=[{"attributes": {"retry_count": 0}}],
161161
),
162162
]
163163
)

0 commit comments

Comments
 (0)