Skip to content

Commit ec4617c

Browse files
committed
Adressing round 1 of feedback
Signed-off-by: Ryan Lettieri <[email protected]>
1 parent 4260d02 commit ec4617c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

durabletask/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def __init__(self, *,
9999
log_handler: Optional[logging.Handler] = None,
100100
log_formatter: Optional[logging.Formatter] = None,
101101
secure_channel: bool = False,
102-
interceptors: Optional[list] = None):
102+
interceptors: Optional[list[DefaultClientInterceptorImpl]] = None):
103103

104104
# Determine the interceptors to use
105105
if interceptors is not None:

durabletask/worker.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ def __init__(self, *,
9191
log_handler=None,
9292
log_formatter: Optional[logging.Formatter] = None,
9393
secure_channel: bool = False,
94-
interceptors: Optional[list[grpc.ServerInterceptor]] = None): # Add interceptors
94+
interceptors: Optional[list[DefaultClientInterceptorImpl]] = None): # Add interceptors
9595
self._registry = _Registry()
9696
self._host_address = host_address if host_address else shared.get_default_host_address()
97-
self._metadata = metadata or [] # Ensure metadata is never None
97+
self._metadata = metadata
9898
self._logger = shared.get_logger("worker", log_handler, log_formatter)
9999
self._shutdown = Event()
100100
self._is_running = False
@@ -129,12 +129,7 @@ def add_activity(self, fn: task.Activity) -> str:
129129

130130
def start(self):
131131
"""Starts the worker on a background thread and begins listening for work items."""
132-
133-
if self._metadata:
134-
interceptors = [DefaultClientInterceptorImpl(self._metadata)]
135-
else:
136-
interceptors = None
137-
channel = shared.get_grpc_channel(self._host_address, self._metadata, self._secure_channel, interceptors)
132+
channel = shared.get_grpc_channel(self._host_address, self._metadata, self._secure_channel, self._interceptors)
138133
stub = stubs.TaskHubSidecarServiceStub(channel)
139134

140135
if self._is_running:

0 commit comments

Comments
 (0)