mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fetch old items for existing subscribed feeds
This commit is contained in:
parent
28bd2c4e25
commit
c82efb31d3
1 changed files with 14 additions and 6 deletions
|
|
@ -88,12 +88,20 @@ export const isOldItem = (
|
|||
item: RssFeedItem,
|
||||
mostRecentItemTimestamp: number
|
||||
) => {
|
||||
// existing items and items that were published before 24h
|
||||
const publishedAt = item.isoDate ? new Date(item.isoDate) : new Date()
|
||||
return (
|
||||
publishedAt <= new Date(mostRecentItemTimestamp) ||
|
||||
publishedAt < new Date(Date.now() - 24 * 60 * 60 * 1000)
|
||||
)
|
||||
// always fetch items without isoDate
|
||||
if (!item.isoDate) {
|
||||
return false
|
||||
}
|
||||
|
||||
const publishedAt = new Date(item.isoDate)
|
||||
|
||||
// don't fetch older than 24 hrs items for new feeds
|
||||
if (!mostRecentItemTimestamp) {
|
||||
return publishedAt < new Date(Date.now() - 24 * 60 * 60 * 1000)
|
||||
}
|
||||
|
||||
// don't fetch existing items for old feeds
|
||||
return publishedAt <= new Date(mostRecentItemTimestamp)
|
||||
}
|
||||
|
||||
const feedFetchFailedRedisKey = (feedUrl: string) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue