diff --git a/src/utils/getHashCache.ts b/src/utils/getHashCache.ts index fac5924..f843836 100644 --- a/src/utils/getHashCache.ts +++ b/src/utils/getHashCache.ts @@ -1,5 +1,5 @@ import redis from "../utils/redis"; -import { userHashKey } from "../utils/redisKeys"; +import { shaHashKey } from "../utils/redisKeys"; import { HashedValue } from "../types/hash.model"; import { Logger } from "../utils/logger"; import { getHash } from "../utils/getHash"; @@ -14,7 +14,7 @@ export async function getHashCache(value: T, times = 5000): Pr } async function getFromRedis(key: HashedValue): Promise { - const redisKey = userHashKey(key); + const redisKey = shaHashKey(key); const { err, reply } = await redis.getAsync(redisKey); if (!err && reply) { diff --git a/src/utils/redisKeys.ts b/src/utils/redisKeys.ts index 8c5d432..2245d2e 100644 --- a/src/utils/redisKeys.ts +++ b/src/utils/redisKeys.ts @@ -25,8 +25,8 @@ export function ratingHashKey(hashPrefix: VideoIDHash, service: Service): string return `rating.${service}.${hashPrefix}`; } -export function userHashKey(userID: HashedValue): string { - if (userID.length !== 64) Logger.warn(`Redis userHash key is not length 64! ${userID}`); +export function shaHashKey(singleIter: HashedValue): string { + if (singleIter.length !== 64) Logger.warn(`Redis sha.hash key is not length 64! ${singleIter}`); - return `user.${userID}`; + return `sha.hash.${singleIter}`; } \ No newline at end of file