Skip to content

Commit afb4d50

Browse files
Update fetch_decision method to set default timeout value to 10 seconds
1 parent 58755f1 commit afb4d50

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

optimizely/cmab/cmab_client.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def fetch_decision(
7373
user_id: str,
7474
attributes: Dict[str, Any],
7575
cmab_uuid: str,
76-
timeout: Optional[float] = None
76+
timeout: float = MAX_WAIT_TIME
7777
) -> str:
7878
"""Fetch a decision from the CMAB prediction service.
7979
@@ -82,13 +82,12 @@ def fetch_decision(
8282
user_id (str): The user ID for the request.
8383
attributes (Dict[str, Any]): User attributes for the request.
8484
cmab_uuid (str): Unique identifier for the CMAB request.
85-
timeout (float): Maximum wait time for request to respond in seconds.
85+
timeout (float): Maximum wait time for request to respond in seconds. Defaults to 10 seconds.
8686
8787
Returns:
8888
str: The variation ID.
8989
"""
9090
url = CMAB_PREDICTION_ENDPOINT % rule_id
91-
timeout = timeout or MAX_WAIT_TIME
9291
cmab_attributes = [
9392
{"id": key, "value": value, "type": "custom_attribute"}
9493
for key, value in attributes.items()

0 commit comments

Comments
 (0)