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 1
1
import os
2
+ import weakref
2
3
from datetime import datetime
3
4
from pathlib import Path
4
5
from typing import Any , List , Optional , Union
@@ -78,6 +79,7 @@ def __init__(
78
79
self .auth_config = auth_config
79
80
assert isinstance (registry_config , RemoteRegistryConfig )
80
81
self .channel = self ._create_grpc_channel (registry_config )
82
+ weakref .finalize (self , self .channel .close )
81
83
82
84
auth_header_interceptor = GrpcClientAuthHeaderInterceptor (auth_config )
83
85
self .channel = grpc .intercept_channel (self .channel , auth_header_interceptor )
@@ -107,9 +109,6 @@ def close(self):
107
109
if self .channel :
108
110
self .channel .close ()
109
111
110
- def __del__ (self ):
111
- self .close ()
112
-
113
112
def apply_entity (self , entity : Entity , project : str , commit : bool = True ):
114
113
request = RegistryServer_pb2 .ApplyEntityRequest (
115
114
entity = entity .to_proto (), project = project , commit = commit
You can’t perform that action at this time.
0 commit comments