Add caching for raw videoID fetching

This commit is contained in:
Ajay Ramachandran
2021-05-23 12:03:05 -04:00
parent 96ccbbe4a2
commit 9d19c59d44
4 changed files with 43 additions and 46 deletions

View File

@@ -528,7 +528,7 @@ export async function postSkipSegments(req: Request, res: Response) {
await privateDB.prepare('run', `INSERT INTO "sponsorTimes" VALUES(?, ?, ?)`, [videoID, hashedIP, timeSubmitted]);
// Clear redis cache for this video
redis.delAsync(skipSegmentsKey(videoID));
redis.delAsync(skipSegmentsKey(videoID, service));
redis.delAsync(skipSegmentsHashKey(hashedVideoID, service));
} catch (err) {
//a DB change probably occurred