Consider a caching strategy for repo_to_installation_id_mapping
Cadair opened this issue · 2 comments
Cadair commented
That function uses a lot of GitHub API calls and takes a long time, it also probably doesnt change that often.
We should cache it and then either blow the cache away on a miss, or just try and extend the cache on a miss. The only thing this plan doesnt handle is how to remove an app from the cache if it is uninstalled on GitHub.
Cadair commented
As in #14 this https://pypi.org/project/expiringdict/#description might be useful here.
astrofrog commented
This is a WIP by @Cadair here: https://github.com/astrofrog/baldrick/pull/17