|
|
@ -134,7 +134,7 @@ export const getAnimeVideoPromo = async (mal_id: number) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (redisClient.connected) {
|
|
|
|
if (redisClient.connected) {
|
|
|
|
const resultQueryRedis: any = await redisClient.get(
|
|
|
|
const resultQueryRedis: any = await redisClient.get(
|
|
|
|
`promoInfo_${hashStringMd5(`${mal_id}`)}`,
|
|
|
|
`getMALpromoInfo_${mal_id}`,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if (resultQueryRedis) {
|
|
|
|
if (resultQueryRedis) {
|
|
|
@ -165,15 +165,15 @@ export const getAnimeVideoPromo = async (mal_id: number) => {
|
|
|
|
/* Set the key in the redis cache. */
|
|
|
|
/* Set the key in the redis cache. */
|
|
|
|
|
|
|
|
|
|
|
|
redisClient.set(
|
|
|
|
redisClient.set(
|
|
|
|
`promoInfo_${hashStringMd5(`${mal_id}`)}`,
|
|
|
|
`getMALpromoInfo_${mal_id}`,
|
|
|
|
JSON.stringify(promo),
|
|
|
|
JSON.stringify(promo),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/* After 24hrs expire the key. */
|
|
|
|
/* After 2hrs expire the key. */
|
|
|
|
|
|
|
|
|
|
|
|
redisClient.expireat(
|
|
|
|
redisClient.expire(
|
|
|
|
`promoInfo_${hashStringMd5(`${mal_id}`)}`,
|
|
|
|
`getMALpromoInfo_${mal_id}`,
|
|
|
|
parseInt(`${+new Date() / 1000}`, 10) + 7200,
|
|
|
|
7200,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|