From f0dc2b2ba85620a343a75af5b053a067c881a661 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Mon, 9 Oct 2023 19:19:42 -0700 Subject: [PATCH] use httpx for usage tracking Co-Authored-By: Judah Rand <17158624+judahrand@users.noreply.github.com> --- src/bentoml/_internal/utils/analytics/usage_stats.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bentoml/_internal/utils/analytics/usage_stats.py b/src/bentoml/_internal/utils/analytics/usage_stats.py index f87057992e5..295c8b17b01 100644 --- a/src/bentoml/_internal/utils/analytics/usage_stats.py +++ b/src/bentoml/_internal/utils/analytics/usage_stats.py @@ -13,7 +13,7 @@ from typing import TYPE_CHECKING import attr -import requests +import httpx from simple_di import Provide from simple_di import inject @@ -122,9 +122,7 @@ def track(event_properties: EventMeta): logger.info("Tracking Payload: %s", payload) return - requests.post( - USAGE_TRACKING_URL, json=payload, timeout=USAGE_REQUEST_TIMEOUT_SECONDS - ) + httpx.post(USAGE_TRACKING_URL, json=payload, timeout=USAGE_REQUEST_TIMEOUT_SECONDS) @inject