Skip to content

Commit

Permalink
fix(retries): move handle failure code outside of while loop (#123)
Browse files Browse the repository at this point in the history
Co-authored-by: Harshal Sheth <hsheth2@gmail.com>
  • Loading branch information
nmbryant and hsheth2 committed Sep 12, 2024
1 parent 36aa93e commit 3da404c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions datahub-actions/src/datahub_actions/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3da404c

Please sign in to comment.