From c7edfdb27d5714dc70e3307517760f92e5e6b344 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 17 Jul 2023 17:27:59 +0800 Subject: [PATCH] fetch items published within 24 hours --- packages/rss-handler/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rss-handler/src/index.ts b/packages/rss-handler/src/index.ts index ababb9177..f4d559b78 100644 --- a/packages/rss-handler/src/index.ts +++ b/packages/rss-handler/src/index.ts @@ -139,10 +139,10 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction( continue } - // skip old items and items that were published before 48h + // skip old items and items that were published before 24h const publishedAt = new Date(item.isoDate) if ( - publishedAt < new Date(Date.now() - 48 * 60 * 60 * 1000) || + publishedAt < new Date(Date.now() - 24 * 60 * 60 * 1000) || publishedAt < new Date(lastFetchedAt) ) { console.log('Skipping old feed item', item.link)