@@ -198,31 +198,31 @@ func (e *matchingEngineImpl) setupExecutor(shardDistributorExecutorClient execut
198198 }
199199 e .taskListsFactory = taskListFactory
200200
201+ // Get the IP address to advertise to external services
202+ // This respects bindOnLocalHost config (127.0.0.1 for local dev, external IP for production)
203+ hostIP , err := rpc .GetListenIP (e .config .RPCConfig )
204+ if err != nil {
205+ e .logger .Fatal ("Failed to get listen IP" , tag .Error (err ))
206+ }
207+
201208 params := executorclient.Params [tasklist.ShardProcessor ]{
202209 ExecutorClient : shardDistributorExecutorClient ,
203210 MetricsScope : e .metricsScope ,
204211 Logger : e .logger ,
205212 ShardProcessorFactory : taskListFactory ,
206213 Config : cfg ,
207214 TimeSource : e .timeSource ,
215+ Metadata : map [string ]string {
216+ "tchannel" : fmt .Sprintf ("%d" , e .config .RPCConfig .Port ),
217+ "grpc" : fmt .Sprintf ("%d" , e .config .RPCConfig .GRPCPort ),
218+ "hostIP" : hostIP .String (),
219+ },
208220 }
209221 executor , err := executorclient.NewExecutor [tasklist.ShardProcessor ](params )
210222 if err != nil {
211- panic ( err )
223+ e . logger . Fatal ( "Failed to create new executor" , tag . Error ( err ) )
212224 }
213225
214- // Get the IP address to advertise to external services
215- // This respects bindOnLocalHost config (127.0.0.1 for local dev, external IP for production)
216- hostIP , err := rpc .GetListenIP (e .config .RPCConfig )
217- if err != nil {
218- e .logger .Fatal ("Failed to get listen IP" , tag .Error (err ))
219- }
220-
221- executor .SetMetadata (map [string ]string {
222- "tchannel" : fmt .Sprintf ("%d" , e .config .RPCConfig .Port ),
223- "grpc" : fmt .Sprintf ("%d" , e .config .RPCConfig .GRPCPort ),
224- "hostIP" : hostIP .String (),
225- })
226226 e .executor = executor
227227}
228228
0 commit comments