From 75a22ae519e8fb7b2984540610b48149340aee30 Mon Sep 17 00:00:00 2001 From: Nate Bryant Date: Tue, 13 Aug 2024 16:20:07 -0400 Subject: [PATCH] fix(retries): move handle failure code outside of while loop --- .../src/datahub_actions/pipeline/pipeline.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/datahub-actions/src/datahub_actions/pipeline/pipeline.py b/datahub-actions/src/datahub_actions/pipeline/pipeline.py index d4f78097..8c0f06b4 100644 --- a/datahub-actions/src/datahub_actions/pipeline/pipeline.py +++ b/datahub-actions/src/datahub_actions/pipeline/pipeline.py @@ -217,15 +217,15 @@ def _process_event(self, enveloped_event: EventEnvelope) -> Optional[bool]: ) curr_attempt = curr_attempt + 1 - logger.error( - f"Failed to process event after {self._retry_count} retries. event type: {enveloped_event.event_type}, pipeline name: {self.name}. Handling failure..." - ) + logger.error( + f"Failed to process event after {self._retry_count} retries. event type: {enveloped_event.event_type}, pipeline name: {self.name}. Handling failure..." + ) - # Increment failed event count. - self._stats.increment_failed_event_count() + # Increment failed event count. + self._stats.increment_failed_event_count() - # Finally, handle the failure - self._handle_failure(enveloped_event) + # Finally, handle the failure + self._handle_failure(enveloped_event) return retval