mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 21:03: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,
|
feedId,
|
||||||
JSON.stringify(mapping),
|
JSON.stringify(mapping),
|
||||||
'EX',
|
'EX',
|
||||||
DEFAULT_CACHE_TTL // Use the constant here
|
DEFAULT_CACHE_TTL
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error storing feed mapping:', 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);
|
const mapping = await redis.get(feedId);
|
||||||
if (!mapping) return null;
|
if (!mapping) return null;
|
||||||
|
|
||||||
|
await redis.expire(feedId, DEFAULT_CACHE_TTL);
|
||||||
|
|
||||||
const data = JSON.parse(mapping);
|
const data = JSON.parse(mapping);
|
||||||
return {
|
return {
|
||||||
slugs: data.slugs,
|
slugs: data.slugs,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue