0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/workers/repository/reconfigure/reconfigure-cache.ts
2023-11-07 15:50:29 +00:00

29 lines
824 B
TypeScript

import { logger } from '../../../logger';
import { getCache } from '../../../util/cache/repository';
export function setReconfigureBranchCache(
reconfigureBranchSha: string,
isConfigValid: boolean,
): void {
const cache = getCache();
const reconfigureBranchCache = {
reconfigureBranchSha,
isConfigValid,
};
if (cache.reconfigureBranchCache) {
logger.debug({ reconfigureBranchCache }, 'Update reconfigure branch cache');
} else {
logger.debug({ reconfigureBranchCache }, 'Create reconfigure branch cache');
}
cache.reconfigureBranchCache = reconfigureBranchCache;
}
export function deleteReconfigureBranchCache(): void {
const cache = getCache();
if (cache?.reconfigureBranchCache) {
logger.debug('Delete reconfigure branch cache');
delete cache.reconfigureBranchCache;
}
}