From 5ce91527a35ef350b3616cf50bc870273550a13b Mon Sep 17 00:00:00 2001 From: Aleksandr Kandrashev Date: Mon, 30 Sep 2024 15:12:06 +0300 Subject: [PATCH] fix proxies --- segment/analytics/request.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/segment/analytics/request.py b/segment/analytics/request.py index 1f5a56e..4118e2c 100644 --- a/segment/analytics/request.py +++ b/segment/analytics/request.py @@ -45,14 +45,14 @@ def post(write_key, host=None, gzip=False, timeout=15, proxies=None, oauth_manag kwargs = { "data": data, "headers": headers, - "timeout": 15, + "timeout": timeout, } if proxies: kwargs['proxies'] = proxies - res = None + try: - res = _session.post(url, data=data, headers=headers, timeout=timeout) + res = _session.post(url, **kwargs) except Exception as e: log.error(e) raise e