mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 19:53:45 -07:00
tweak backend by allowing feed ids to have their TTL reset
This commit is contained in:
parent
07d245e94d
commit
b8499d90c6
1 changed files with 3 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ export async function storeFeedMapping(feedId: string, slugs: string[], lang: st
|
|||
feedId,
|
||||
JSON.stringify(mapping),
|
||||
'EX',
|
||||
DEFAULT_CACHE_TTL // Use the constant here
|
||||
DEFAULT_CACHE_TTL
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Error storing feed mapping:', error);
|
||||
|
|
@ -128,6 +128,8 @@ export async function getFeedMapping(feedId: string): Promise<FeedMapping | null
|
|||
const mapping = await redis.get(feedId);
|
||||
if (!mapping) return null;
|
||||
|
||||
await redis.expire(feedId, DEFAULT_CACHE_TTL);
|
||||
|
||||
const data = JSON.parse(mapping);
|
||||
return {
|
||||
slugs: data.slugs,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue