Skip to content

Commit 05e67bd

Browse files
authored
Gunicorn with 4 workers (#295)
* change missing country code to debug level * set gunicorn config to 4 workers * log worker id
1 parent 5a605ec commit 05e67bd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: gunicorn app.main:APP -k uvicorn.workers.UvicornWorker
1+
web: gunicorn app.main:APP -w 4 -k uvicorn.workers.UvicornWorker

app/services/location/jhu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""app.services.location.jhu.py"""
22
import csv
33
import logging
4+
import os
45
from datetime import datetime
56

67
from asyncache import cached
@@ -57,7 +58,7 @@ async def get_category(category):
5758
url = BASE_URL + "time_series_covid19_%s_global.csv" % category
5859

5960
# Request the data
60-
LOGGER.info("jhu Requesting data...")
61+
LOGGER.info(f"pid:{os.getpid()}: jhu Requesting data...")
6162
async with httputils.CLIENT_SESSION.get(url) as response:
6263
text = await response.text()
6364

app/utils/countries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,6 @@ def country_code(value):
374374
"""
375375
code = COUNTRY_NAME__COUNTRY_CODE.get(value, DEFAULT_COUNTRY_CODE)
376376
if code == DEFAULT_COUNTRY_CODE:
377-
LOGGER.info(f"No country code found for '{value}'. Using '{code}'!")
377+
LOGGER.debug(f"No country code found for '{value}'. Using '{code}'!")
378378

379379
return code

0 commit comments

Comments
 (0)