Allow video labels cashing with prefix of 4

This commit is contained in:
Ajay
2025-01-18 00:22:17 -05:00
parent 2455d2cd7e
commit 80b1019783
2 changed files with 3 additions and 4 deletions

View File

@@ -58,10 +58,9 @@ export const videoLabelsKey = (videoID: VideoID, service: Service): string =>
`labels.v2.${service}.videoID.${videoID}`;
export function videoLabelsHashKey(hashedVideoIDPrefix: VideoIDHash, service: Service): string {
hashedVideoIDPrefix = hashedVideoIDPrefix.substring(0, 3) as VideoIDHash;
if (hashedVideoIDPrefix.length !== 3) Logger.warn(`Redis video labels hash-prefix key is not length 3! ${hashedVideoIDPrefix}`);
const length = hashedVideoIDPrefix.length;
return `labels.v1.${service}.${hashedVideoIDPrefix}`;
return `labels.v1.${length}.${service}.${hashedVideoIDPrefix}`;
}
export function userFeatureKey (userID: HashedUserID, feature: Feature): string {