From 8441533d93aa3fbfe817690212658d413f801b0e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sat, 18 Apr 2020 20:31:21 -0400 Subject: [PATCH 1/3] change missing country code to debug level --- app/utils/countries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/countries.py b/app/utils/countries.py index ebb09bb3..d239b5ee 100644 --- a/app/utils/countries.py +++ b/app/utils/countries.py @@ -374,6 +374,6 @@ def country_code(value): """ code = COUNTRY_NAME__COUNTRY_CODE.get(value, DEFAULT_COUNTRY_CODE) if code == DEFAULT_COUNTRY_CODE: - LOGGER.info(f"No country code found for '{value}'. Using '{code}'!") + LOGGER.debug(f"No country code found for '{value}'. Using '{code}'!") return code From 0b012a6169bd53550bb3628c76c061b640baf85a Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sat, 18 Apr 2020 20:36:47 -0400 Subject: [PATCH 2/3] set gunicorn config to 4 workers --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index dd838293..094ebc0a 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn app.main:APP -k uvicorn.workers.UvicornWorker \ No newline at end of file +web: gunicorn app.main:APP -w 4 -k uvicorn.workers.UvicornWorker From e001760d7f3170d81fc75af44b7b938a31973f26 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Sat, 18 Apr 2020 20:38:09 -0400 Subject: [PATCH 3/3] log worker id --- app/services/location/jhu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/location/jhu.py b/app/services/location/jhu.py index 21990c8c..53aa6ff9 100644 --- a/app/services/location/jhu.py +++ b/app/services/location/jhu.py @@ -1,6 +1,7 @@ """app.services.location.jhu.py""" import csv import logging +import os from datetime import datetime from asyncache import cached @@ -57,7 +58,7 @@ async def get_category(category): url = BASE_URL + "time_series_covid19_%s_global.csv" % category # Request the data - LOGGER.info("jhu Requesting data...") + LOGGER.info(f"pid:{os.getpid()}: jhu Requesting data...") async with httputils.CLIENT_SESSION.get(url) as response: text = await response.text()