Skip to content

Commit bbb6237

Browse files
committed
fix: Stop FeatureStoreClientWrapper poller on close
1 parent 1cbcfd8 commit bbb6237

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ldclient/impl/datasystem/fdv2.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ def is_monitoring_enabled(self) -> bool:
228228
return False
229229

230230
return monitoring_enabled()
231+
232+
def close(self):
233+
"""
234+
Close the wrapper and stop the repeating task poller if it's running.
235+
This is called by Store.close() during shutdown to ensure the poller thread is stopped.
236+
"""
237+
poller_to_stop = None
238+
with self.__lock.write():
239+
poller_to_stop = self.__poller
240+
self.__poller = None
241+
242+
if poller_to_stop is not None:
243+
poller_to_stop.stop()
231244

232245

233246
class FDv2(DataSystem):

0 commit comments

Comments
 (0)