A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: round feed refresh hour for idempotency (#2013)
Mohamed Bassembae8386d3685
diff --git a/apps/workers/workers/feedWorker.ts b/apps/workers/workers/feedWorker.tsindex 048d9696..19076b50 100644--- a/apps/workers/workers/feedWorker.ts+++ b/apps/workers/workers/feedWorker.ts@@ -26,13 +26,18 @@ export const FeedRefreshingWorker = cron.schedule(where: eq(rssFeedsTable.enabled, true),}).then((feeds) => {+ const currentHour = new Date();+ currentHour.setMinutes(0, 0, 0);+ const hourlyWindow = currentHour.toISOString();+for (const feed of feeds) {+ const idempotencyKey = `${feed.id}-${hourlyWindow}`;FeedQueue.enqueue({feedId: feed.id,},{- idempotencyKey: feed.id,+ idempotencyKey,},);}