File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
sdk/python/feast/infra/registry Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 11import os
2+ import weakref
23from datetime import datetime
34from pathlib import Path
45from typing import Any , List , Optional , Union
@@ -78,6 +79,7 @@ def __init__(
7879 self .auth_config = auth_config
7980 assert isinstance (registry_config , RemoteRegistryConfig )
8081 self .channel = self ._create_grpc_channel (registry_config )
82+ weakref .finalize (self , self .channel .close )
8183
8284 auth_header_interceptor = GrpcClientAuthHeaderInterceptor (auth_config )
8385 self .channel = grpc .intercept_channel (self .channel , auth_header_interceptor )
@@ -107,9 +109,6 @@ def close(self):
107109 if self .channel :
108110 self .channel .close ()
109111
110- def __del__ (self ):
111- self .close ()
112-
113112 def apply_entity (self , entity : Entity , project : str , commit : bool = True ):
114113 request = RegistryServer_pb2 .ApplyEntityRequest (
115114 entity = entity .to_proto (), project = project , commit = commit
You can’t perform that action at this time.
0 commit comments