@@ -59,15 +59,15 @@ def retrieve_or_create_channel(self, endpoints: RpcEndpoints):
5959 raise Exception ("RpcClient is not running." )
6060 try :
6161 # get or create a new grpc channel
62- channel = self .__get_channel (endpoints )
63- if channel is not None :
64- channel .update_time = int (time .time ())
65- else :
66- with RpcClient ._channel_lock :
67- channel = RpcChannel (endpoints , self .__tls_enable )
68- channel .create_channel (RpcClient .get_channel_io_loop ())
69- self .__put_channel (endpoints , channel )
70- return channel
62+ channel = self .__get_channel (endpoints )
63+ if channel is not None :
64+ channel .update_time = int (time .time ())
65+ else :
66+ with RpcClient ._channel_lock :
67+ channel = RpcChannel (endpoints , self .__tls_enable )
68+ channel .create_channel (RpcClient .get_channel_io_loop ())
69+ self .__put_channel (endpoints , channel )
70+ return channel
7171 except Exception as e :
7272 logger .error (f"retrieve or create channel exception: { e } " )
7373 raise e
@@ -139,7 +139,7 @@ def notify_client_termination(self, endpoints: RpcEndpoints, req: NotifyClientTe
139139
140140 def end_transaction_for_server_check (self , endpoints : RpcEndpoints , req : EndTransactionRequest , metadata ,
141141 timeout = 3 ):
142- ## assert asyncio.get_running_loop() == RpcClient._io_loop
142+ # assert asyncio.get_running_loop() == RpcClient._io_loop
143143 try :
144144 return self .__end_transaction_0 (endpoints , req , metadata = metadata , timeout = timeout )
145145 except Exception as e :
@@ -204,7 +204,6 @@ async def __notify_client_termination_0(self, endpoints: RpcEndpoints, req: Noti
204204 async def __create_channel_async (self , endpoints : RpcEndpoints ):
205205 return self .retrieve_or_create_channel (endpoints )
206206
207-
208207 """ private """
209208
210209 def __get_channel (self , endpoints : RpcEndpoints ) -> RpcChannel :
0 commit comments