From 9507c28a7e055534724499a856bd26ca08502776 Mon Sep 17 00:00:00 2001 From: Praneeth Bedapudi Date: Mon, 11 Nov 2024 12:03:33 +0530 Subject: [PATCH] optional requests session with use_requests_session Signed-off-by: Praneeth Bedapudi --- clients/python/fdclient/client.py | 4 ++-- clients/python/setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/python/fdclient/client.py b/clients/python/fdclient/client.py index c6abfdc..497de75 100644 --- a/clients/python/fdclient/client.py +++ b/clients/python/fdclient/client.py @@ -17,14 +17,14 @@ class FDClient: - def __init__(self, server_url, request_timeout, compression=True): + def __init__(self, server_url, request_timeout, compression=True, use_requests_session=False): assert server_url.startswith("http://") or server_url.startswith( "https://" ), "Server URL must start with http:// or https://" self.server_url = server_url self.local_storage = threading.local() - self.requests_session = requests.Session() + self.requests_session = requests.Session() if use_requests_session else requests self.compression = compression if zstandard is not None else False self.input_type = None self._set_input_type() diff --git a/clients/python/setup.py b/clients/python/setup.py index e9cdf44..541714d 100644 --- a/clients/python/setup.py +++ b/clients/python/setup.py @@ -18,7 +18,7 @@ EMAIL = "praneeth@bpraneeth.com" AUTHOR = "BEDAPUDI PRANEETH" REQUIRES_PYTHON = ">=3.6.0" -VERSION = "3.1.0" +VERSION = "3.1.1" # What packages are required for this module to be executed? REQUIRED = ["zstandard", "requests", "msgpack"]