chore: generate

This commit is contained in:
Fernandez Ludovic 2024-05-04 17:38:54 +02:00
parent 8c0f59df12
commit 3f9b554aae
2 changed files with 10 additions and 4 deletions

7
dist/post_run/index.js generated vendored
View file

@ -88815,15 +88815,18 @@ const getLintCacheDir = () => {
};
const getIntervalKey = (invalidationIntervalDays) => {
const now = new Date();
if (invalidationIntervalDays <= 0) {
return `${now.getTime()}`;
}
const secondsSinceEpoch = now.getTime() / 1000;
const intervalNumber = Math.floor(secondsSinceEpoch / (invalidationIntervalDays * 86400));
return intervalNumber.toString();
};
async function buildCacheKeys() {
const keys = [];
const invalidationIntervalDays = parseInt(core.getInput(`cache-invalidation-interval`, { required: true }).trim());
// Periodically invalidate a cache because a new code being added.
// TODO: configure it via inputs.
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
let cacheKey = `golangci-lint.cache-${getIntervalKey(invalidationIntervalDays)}-`;
keys.push(cacheKey);
// Get working directory from input
const workingDirectory = core.getInput(`working-directory`);

7
dist/run/index.js generated vendored
View file

@ -88815,15 +88815,18 @@ const getLintCacheDir = () => {
};
const getIntervalKey = (invalidationIntervalDays) => {
const now = new Date();
if (invalidationIntervalDays <= 0) {
return `${now.getTime()}`;
}
const secondsSinceEpoch = now.getTime() / 1000;
const intervalNumber = Math.floor(secondsSinceEpoch / (invalidationIntervalDays * 86400));
return intervalNumber.toString();
};
async function buildCacheKeys() {
const keys = [];
const invalidationIntervalDays = parseInt(core.getInput(`cache-invalidation-interval`, { required: true }).trim());
// Periodically invalidate a cache because a new code being added.
// TODO: configure it via inputs.
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
let cacheKey = `golangci-lint.cache-${getIntervalKey(invalidationIntervalDays)}-`;
keys.push(cacheKey);
// Get working directory from input
const workingDirectory = core.getInput(`working-directory`);