Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Nick: moving count_jobs_of_crawl_team to read replica

Nicolas07bbe2cb0395
diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts
index be2d2b21c..9595f853b 100644
--- a/apps/api/src/controllers/v1/crawl-status.ts
+++ b/apps/api/src/controllers/v1/crawl-status.ts
@@ -276,8 +276,8 @@ export async function crawlStatusController(
)
}
} else if (process.env.USE_DB_AUTHENTICATION === "true") {
- // TODO: move to read replica
- const { data: scrapeJobCounts, error: scrapeJobError } = await supabase_service
+
+ const { data: scrapeJobCounts, error: scrapeJobError } = await supabase_rr_service
.rpc("count_jobs_of_crawl_team", { i_crawl_id: req.params.jobId, i_team_id: req.auth.team_id });
if (scrapeJobError || !scrapeJobCounts || scrapeJobCounts.length === 0) {