everypolitician / wikidata-fetcher

Fetch information useful to EveryPolitician from Wikidata
MIT License
4 stars 2 forks source link

Don't load lookup.json for each person #35

Closed chrismytton closed 8 years ago

chrismytton commented 8 years ago

The Fetcher class is instantiated for each person that we want to lookup data for, which meant that previously we were making an http request to fetch lookup.json for every person.

This change makes it so that the lookup is at the class level, so is only fetched on the first call and then cached for subsequent calls.

Fixes https://github.com/everypolitician/wikidata-fetcher/issues/33

chrismytton commented 8 years ago

@tmtmtmtm 👀

chrismytton commented 8 years ago

Feedback addressed. @tmtmtmtm 👀

tmtmtmtm commented 8 years ago

Woot!