Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

recreating service on exception #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cadence/activity_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def activity_task_loop(worker: Worker):
return
except Exception as ex:
logger.error("PollForActivityTask error: %s", ex)
# possible that connection with cadence server broke, so recreating
try:
service: WorkflowService = WorkflowService.create(worker.host, worker.port,
timeout=worker.get_timeout())
worker.manage_service(service)
except Exception as ex:
logger.error(f"Could not create workflow service due to: {ex}")
continue
if err:
logger.error("PollForActivityTask failed: %s", err)
Expand Down