Skip to content

Commit 975a424

Browse files
committed
fix
1 parent a385577 commit 975a424

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

langfuse/_client/resource_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ def _initialize_instance(
256256

257257
@classmethod
258258
def reset(cls):
259-
cls._instances.clear()
259+
for key in cls._instances:
260+
cls._instances.pop(key).shutdown()
260261

261262
def add_score_task(self, event: dict, *, force_sample: bool = False):
262263
try:

tests/test_core_sdk.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pytest
88

99
from langfuse import Langfuse
10+
from langfuse._client.resource_manager import LangfuseResourceManager
1011
from langfuse._utils import _get_timestamp
1112
from tests.api_wrapper import LangfuseAPI
1213
from tests.utils import (
@@ -1781,6 +1782,8 @@ def test_create_trace_sampling_zero():
17811782

17821783

17831784
def test_mask_function():
1785+
LangfuseResourceManager.reset()
1786+
17841787
def mask_func(data):
17851788
if isinstance(data, dict):
17861789
if "should_raise" in data:

0 commit comments

Comments
 (0)