Skip to content
Snippets Groups Projects
Commit 1f49d0fe authored by Rhys Arkins's avatar Rhys Arkins
Browse files

feat: add in-memory github datasource caching

parent 790cd9de
No related branches found
Tags 13.53.0
No related merge requests found
......@@ -6,6 +6,8 @@ module.exports = {
getPkgReleases,
};
const map = new Map();
async function getPreset(pkgName, presetName = 'default') {
if (presetName !== 'default') {
throw new Error(
......@@ -42,7 +44,10 @@ async function getPkgReleases(purl, config) {
} else {
// tag
const url = `repos/${repo}/tags?per_page=100`;
versions = (await ghGot(url, { paginate: true })).body.map(o => o.name);
versions = (await ghGot(url, {
cache: process.env.RENOVATE_SKIP_CACHE ? undefined : map,
paginate: true,
})).body.map(o => o.name);
}
} catch (err) {
logger.info(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment