From 5780c38b95a68b040f3173dbad6e014a88bfa364 Mon Sep 17 00:00:00 2001 From: Billa32 <87912290+Billa32@users.noreply.github.com> Date: Sun, 25 Jul 2021 23:38:30 -0400 Subject: [PATCH] Update jhu.py Imported newly created class and getting the baseUrl for Jhu from BaseUrl Class --- app/services/location/jhu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/location/jhu.py b/app/services/location/jhu.py index ebed3960..6b47efb6 100644 --- a/app/services/location/jhu.py +++ b/app/services/location/jhu.py @@ -16,6 +16,7 @@ from ...utils import date as date_util from ...utils import httputils from . import LocationService +from ...utils.baseurls import BaseUrl LOGGER = logging.getLogger("services.location.jhu") PID = os.getpid() @@ -41,7 +42,7 @@ async def get(self, loc_id): # pylint: disable=arguments-differ # Base URL for fetching category. -BASE_URL = "https://raw.githubusercontent.com/CSSEGISandData/2019-nCoV/master/csse_covid_19_data/csse_covid_19_time_series/" +BASE_URL = BaseUrl.JHU @cached(cache=TTLCache(maxsize=4, ttl=1800)) @@ -226,3 +227,4 @@ def parse_history(key: tuple, locations: list, index: int): LOGGER.debug(f"iteration data merge error: {index} {key}") return location_history +