fix caching issue with no related data

This commit is contained in:
La macchina desiderante 2024-05-18 11:50:19 +02:00
parent 5245125097
commit 15deeddd14
2 changed files with 4 additions and 2 deletions

View File

@ -63,6 +63,8 @@ export const fetchXNXXVideoData = async (videoId: string, params?: FetchParams):
})
await storeDataIntoRedis(queryUrl, data, DEFAULT_XNXX_CONTENT_EXPIRY);
// populate related gallery
scriptTags.map((idx, elem) => {
const relatedVideos = findRelatedVideos($(elem).toString(), Platforms.xnxx)
@ -73,7 +75,6 @@ export const fetchXNXXVideoData = async (videoId: string, params?: FetchParams):
})
await storeDataIntoRedis(queryUrl + DEFAULT_RELATED_VIDEO_KEY_PATH, related, DEFAULT_XNXX_CONTENT_EXPIRY);
await storeDataIntoRedis(queryUrl, data, DEFAULT_XNXX_CONTENT_EXPIRY);
}).catch((error: AxiosError) => {
// handle errors

View File

@ -63,6 +63,8 @@ export const fetchXvideosVideoData = async (videoId: string, params?: FetchParam
})
await storeDataIntoRedis(queryUrl, data, DEFAULT_XVIDEOS_CONTENT_EXPIRY);
// populate related gallery
scriptTags.map((idx, elem) => {
const relatedVideos = findRelatedVideos($(elem).toString(), Platforms.xvideos)
@ -73,7 +75,6 @@ export const fetchXvideosVideoData = async (videoId: string, params?: FetchParam
})
await storeDataIntoRedis(queryUrl + DEFAULT_RELATED_VIDEO_KEY_PATH, related, DEFAULT_XVIDEOS_CONTENT_EXPIRY);
await storeDataIntoRedis(queryUrl, data, DEFAULT_XVIDEOS_CONTENT_EXPIRY);
}).catch((error: AxiosError) => {
// handle errors