A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: Dont attempt to fetch rss if the user if out of quota
Mohamed Bassema0dd73f5aaba
diff --git a/apps/workers/workers/feedWorker.ts b/apps/workers/workers/feedWorker.tsindex 62106fc8..74b5f65c 100644--- a/apps/workers/workers/feedWorker.ts+++ b/apps/workers/workers/feedWorker.ts@@ -9,6 +9,7 @@ import { z } from "zod";import type { ZFeedRequestSchema } from "@karakeep/shared/queues";import { db } from "@karakeep/db";import { rssFeedImportsTable, rssFeedsTable } from "@karakeep/db/schema";+import { QuotaService } from "@karakeep/shared-server";import logger from "@karakeep/shared/logger";import { FeedQueue } from "@karakeep/shared/queues";import { BookmarkTypes } from "@karakeep/shared/types/bookmarks";@@ -94,6 +95,18 @@ async function run(req: DequeuedJob<ZFeedRequestSchema>) {`[feed][${jobId}] Feed with id ${req.data.feedId} not found`,);}++ // If the user doesn't have bookmark quota, don't bother with fetching the feed+ {+ const quotaResult = await QuotaService.canCreateBookmark(db, feed.userId);+ if (!quotaResult.result) {+ logger.debug(+ `[feed][${jobId}] User ${feed.userId} doesn't have enough quota to create bookmarks. Skipping feed fetching.`,+ );+ return;+ }+ }+logger.info(`[feed][${jobId}] Starting fetching feed "${feed.name}" (${feed.id}) ...`,);