Skip to content

Commit

Permalink
Implement shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Aug 7, 2024
1 parent 42aad2b commit e7e28fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion configcat_openfeature_provider/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def __init__(self, sdk_key: str, options: typing.Optional[ConfigCatOptions] = No
def get_metadata(self) -> Metadata:
return Metadata("ConfigCatProvider")

def shutdown(self) -> None:
self.client.close()

def resolve_boolean_details(
self,
flag_key: str,
Expand Down Expand Up @@ -80,7 +83,7 @@ def resolve_object_details(
evaluation_context: typing.Optional[EvaluationContext] = None,
) -> FlagResolutionDetails[typing.Union[dict, list]]:
user = self.__ctx_to_user(evaluation_context)
details = self.client.get_value_details(flag_key, default_value, user)
details = self.client.get_value_details(flag_key, "", user)

if not isinstance(details.value, str):
return self.__mismatched_type(default_value)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def provider_client():
"local",
ConfigCatOptions(
flag_overrides=LocalFileFlagOverrides(
file_path=path.join(path.dirname(__file__), "data/test_json_complex.json"),
file_path=path.join(
path.dirname(__file__), "data/test_json_complex.json"
),
override_behaviour=OverrideBehaviour.LocalOnly,
),
polling_mode=PollingMode.auto_poll(60),
Expand Down

0 comments on commit e7e28fb

Please sign in to comment.