mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
send last fetched at as a unix timestamp in ms
This commit is contained in:
parent
234b51af28
commit
cd440a77c3
2 changed files with 5 additions and 5 deletions
|
|
@ -573,7 +573,7 @@ export const enqueueRssFeedFetch = async (
|
|||
const payload = {
|
||||
subscriptionId: rssFeedSubscription.id,
|
||||
feedUrl: rssFeedSubscription.url,
|
||||
lastFetchedAt: rssFeedSubscription.lastFetchedAt,
|
||||
lastFetchedAt: rssFeedSubscription.lastFetchedAt?.getTime() || 0, // unix timestamp in milliseconds
|
||||
}
|
||||
|
||||
const headers = {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { CONTENT_FETCH_URL, createCloudTask } from './task'
|
|||
interface RssFeedRequest {
|
||||
subscriptionId: string
|
||||
feedUrl: string
|
||||
lastFetchedAt: string
|
||||
lastFetchedAt: number // unix timestamp in milliseconds
|
||||
}
|
||||
|
||||
interface ValidRssFeedItem {
|
||||
|
|
@ -180,10 +180,10 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction(
|
|||
// skip old items and items that were published before 24h
|
||||
const publishedAt = new Date(item.isoDate)
|
||||
if (
|
||||
publishedAt < new Date(Date.now() - 24 * 60 * 60 * 1000) ||
|
||||
publishedAt < new Date(lastFetchedAt)
|
||||
publishedAt < new Date(lastFetchedAt) ||
|
||||
publishedAt < new Date(Date.now() - 24 * 60 * 60 * 1000)
|
||||
) {
|
||||
console.log('Skipping old feed item', item.link)
|
||||
console.log('Skipping old feed item', lastValidItem.link)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue