From af85f1031aebcbddd59fee0ee31b01d87913c914 Mon Sep 17 00:00:00 2001 From: Rob Cameron Date: Thu, 2 Mar 2023 08:33:59 -0800 Subject: [PATCH] Use formatCacheKey() when deleting a key (#7362) --- packages/api/src/cache/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/api/src/cache/index.ts b/packages/api/src/cache/index.ts index 260bbda2b89c..991d53bdd206 100644 --- a/packages/api/src/cache/index.ts +++ b/packages/api/src/cache/index.ts @@ -187,19 +187,20 @@ export const createCache = ( const deleteCacheKey = async (key: CacheKey) => { let result + const cacheKey = formatCacheKey(key, prefix) try { await Promise.race([ - (result = client.del(key as string)), + (result = client.del(cacheKey as string)), wait(timeout).then(() => { throw new CacheTimeoutError() }), ]) - logger?.debug(`[Cache] DEL '${key}'`) + logger?.debug(`[Cache] DEL '${cacheKey}'`) return result } catch (e: any) { - logger?.error(`[Cache] Error DEL '${key}': ${e.message}`) + logger?.error(`[Cache] Error DEL '${cacheKey}': ${e.message}`) return false } }