Skip to content

Commit afe32d1

Browse files
committed
fix: new channel on action retry
1 parent c6e1806 commit afe32d1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hatchet_sdk/clients/dispatcher.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,11 @@ class ActionListenerImpl(WorkerActionListener):
127127

128128
def __init__(
129129
self,
130-
client: DispatcherStub,
131-
aio_client: DispatcherStub,
132130
config: ClientConfig,
133131
worker_id,
134132
):
135-
self.aio_client = aio_client
136-
self.client = client
137133
self.config = config
134+
self.aio_client = DispatcherStub(new_conn(config, True))
138135
self.token = config.token
139136
self.worker_id = worker_id
140137
self.retries = 0
@@ -309,6 +306,8 @@ async def get_listen_client(self):
309306
f"Could not connect to Hatchet, retrying... {self.retries}/{DEFAULT_ACTION_LISTENER_RETRY_COUNT}"
310307
)
311308

309+
self.aio_client = DispatcherStub(new_conn(self.config, True))
310+
312311
if self.listen_strategy == "v2":
313312
listener = self.aio_client.ListenV2(
314313
WorkerListenRequest(workerId=self.worker_id),
@@ -374,7 +373,7 @@ async def get_action_listener(
374373
)
375374

376375
return ActionListenerImpl(
377-
self.client, self.aio_client, self.config, response.workerId
376+
self.config, response.workerId
378377
)
379378

380379
async def send_step_action_event(self, in_: StepActionEvent):

0 commit comments

Comments
 (0)