React to feeback and change to use 0.2.0 cache package

This commit is contained in:
Aiqiao Yan 2020-05-19 13:46:58 -04:00
parent 249a22026d
commit bcc23b930f
10 changed files with 5098 additions and 5604 deletions

View file

@ -12,7 +12,7 @@ export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
}
export function setCacheState(state: string): void {
core.saveState(State.CacheResult, state);
core.saveState(State.CacheMatchedKey, state);
}
export function setCacheHitOutput(isCacheHit: boolean): void {
@ -21,12 +21,12 @@ export function setCacheHitOutput(isCacheHit: boolean): void {
export function setOutputAndState(key: string, cacheKey?: string): void {
setCacheHitOutput(isExactKeyMatch(key, cacheKey));
// Store the cache result if it exists
// Store the matched cache key if it exists
cacheKey && setCacheState(cacheKey);
}
export function getCacheState(): string | undefined {
const cacheKey = core.getState(State.CacheResult);
const cacheKey = core.getState(State.CacheMatchedKey);
if (cacheKey) {
core.debug(`Cache state/key: ${cacheKey}`);
return cacheKey;