Clear query cache for branding

This commit is contained in:
Ajay
2023-03-29 00:32:29 -04:00
parent 19ebca86c9
commit 4696ce8d01
3 changed files with 16 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import { getService } from "../utils/getService";
import { isUserVIP } from "../utils/isUserVIP";
import { Logger } from "../utils/logger";
import crypto from "crypto";
import { QueryCacher } from "../utils/queryCacher";
enum BrandingType {
Title,
@@ -96,6 +97,7 @@ export async function postBranding(req: Request, res: Response) {
}
})()]);
QueryCacher.clearBrandingCache({ videoID, hashedVideoID, service });
res.status(200).send("OK");
} catch (e) {
Logger.error(e as string);

View File

@@ -44,6 +44,11 @@ export async function postClearCache(req: Request, res: Response): Promise<Respo
hashedVideoID,
service
});
QueryCacher.clearBrandingCache({
videoID,
hashedVideoID,
service
});
return res.status(200).json({
message: `Cache cleared on video ${videoID}`
});