Skip to content

Commit

Permalink
Revert memcache changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jan 15, 2024
1 parent e9c5fca commit 7684c86
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/util/cache/memory/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
declare const global: {
renovateMemCache: Record<string, any> | undefined;
};

global.renovateMemCache = undefined;
let repoCache: Record<string, any> | undefined;

export function init(): void {
global.renovateMemCache = {};
repoCache = {};
}

export function reset(): void {
global.renovateMemCache = undefined;
repoCache = undefined;
}

export function get<T = any>(key: string): T {
return global.renovateMemCache?.[key];
return repoCache?.[key];
}

export function set(key: string, value: unknown): void {
if (global.renovateMemCache) {
global.renovateMemCache[key] = value;
if (repoCache) {
repoCache[key] = value;
}
}

0 comments on commit 7684c86

Please sign in to comment.