Skip to content

Commit

Permalink
fix: add retry for exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfaircloth committed Sep 1, 2023
1 parent 68b3461 commit 347fdff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions microsoft_azure_eventhub_source/LogSourcePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import logging
import os
from datetime import datetime
import backoff

import orjson
from azure.eventhub import EventData, PartitionContext, TransportType
from azure.eventhub.exceptions import EventHubError
from azure.eventhub.aio import EventHubConsumerClient
from azure.eventhub.extensions.checkpointstoreblobaio import BlobCheckpointStore
from dotenv import load_dotenv
Expand Down Expand Up @@ -111,6 +113,8 @@ def request_exit(self):
logger.info("Exit called by syslog-ng")
self._cancelled = True

@backoff.on_exception(backoff.expo,
EventHubError)
async def run_async(self):
"""Actual start of process"""

Expand Down
2 changes: 2 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[virtualenvs]
in-project = true

0 comments on commit 347fdff

Please sign in to comment.