covidAPI icon indicating copy to clipboard operation
covidAPI copied to clipboard

countries sorted by cases for api get all countries

Open Dicksenz opened this issue 4 years ago • 6 comments

Dicksenz avatar Mar 28 '20 18:03 Dicksenz

Hi! First of all thanks!

The problem I see here is, it is sorting every single time there is a request (300 requests/second are reaching the host at the moment). What if we do the sorting right before saving it to db? that we will already be sorted when fetching it and only happens once every 3 minutes...

javieraviles avatar Mar 28 '20 19:03 javieraviles

Thats a good idea should be fine.

Dicksenz avatar Mar 28 '20 19:03 Dicksenz

The web scraping part i don't know . You used cheerio manipulating the data? The table there is already sorted i think.

Dicksenz avatar Mar 28 '20 19:03 Dicksenz

Seems like the only one out of place is china isnt it? maybe we should just investigate why

javieraviles avatar Mar 28 '20 19:03 javieraviles

Yes can you sort before insert to db?

Dicksenz avatar Mar 28 '20 20:03 Dicksenz

I think we should sort in the api get itself

Dicksenz avatar Mar 28 '20 21:03 Dicksenz