File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change 11
2- import { GetStaticProps , InferGetStaticPropsType } from 'next' ;
32import { RSSFeed } from '../types/rss' ;
43import { parseRSSFeed } from '../lib/rssParser' ;
54
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export async function parseRSSFeed(url: string): Promise<RSSFeed> {
3030 // Handle both single item and array of items
3131 const rawItems = Array . isArray ( channel . item ) ? channel . item : [ channel . item ] . filter ( Boolean ) ;
3232
33+ // eslint-disable-next-line
3334 const items : RSSItem [ ] = rawItems . map ( ( item : any ) => ( {
3435 title : item . title || '' ,
3536 description : item . description || '' ,
@@ -87,7 +88,7 @@ class RSSCache {
8788
8889 if ( ! entry ) return null ;
8990
90- const isExpired = Date . now ( ) - entry . timestamp > entry . ttl ;
91+ const isExpired = Date . now ( ) - entry . timestamp > entry . ttl || Date . now ( ) - entry . timestamp > ( ttlMinutes * 60 * 1000 ) ;
9192 if ( isExpired ) {
9293 this . cache . delete ( url ) ;
9394 return null ;
You can’t perform that action at this time.
0 commit comments