Skip to content

Commit

Permalink
Merge pull request #82 from hatchet-dev/fix--retry-listener-delay
Browse files Browse the repository at this point in the history
fix: retry listener delay
  • Loading branch information
grutt authored Jul 8, 2024
2 parents 8238964 + 10b74d7 commit 17ffdbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion hatchet_sdk/clients/workflow_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ..logger import logger
from ..metadata import get_metadata

DEFAULT_WORKFLOW_LISTENER_RETRY_INTERVAL = 1 # seconds
DEFAULT_WORKFLOW_LISTENER_RETRY_INTERVAL = 3 # seconds
DEFAULT_WORKFLOW_LISTENER_RETRY_COUNT = 5
DEFAULT_WORKFLOW_LISTENER_INTERRUPT_INTERVAL = 1800 # 30 minutes

Expand Down Expand Up @@ -111,6 +111,9 @@ async def _init_producer(self):

t.cancel()
self.listener.cancel()
await asyncio.sleep(
DEFAULT_WORKFLOW_LISTENER_RETRY_INTERVAL
)
break

workflow_event: WorkflowRunEvent = t.result()
Expand All @@ -125,7 +128,9 @@ async def _init_producer(self):

except grpc.RpcError as e:
logger.error(f"grpc error in workflow run listener: {e}")
await asyncio.sleep(DEFAULT_WORKFLOW_LISTENER_RETRY_INTERVAL)
continue

except Exception as e:
logger.error(f"Error in workflow run listener: {e}")

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 = "hatchet-sdk"
version = "0.27.5"
version = "0.27.6"
description = ""
authors = ["Alexander Belanger <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 17ffdbd

Please sign in to comment.