Skip to content

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

Nick: more read replicas

Nicolas783fad90ddab
diff --git a/apps/api/src/lib/extract/team-id-sync.ts b/apps/api/src/lib/extract/team-id-sync.ts
index 8cf21a141..90a326519 100644
--- a/apps/api/src/lib/extract/team-id-sync.ts
+++ b/apps/api/src/lib/extract/team-id-sync.ts
@@ -1,9 +1,9 @@
-import { supabase_service } from "../../services/supabase";
+import { supabase_rr_service, supabase_service } from "../../services/supabase";
import { logger } from "../logger";
export async function getTeamIdSyncB(teamId: string) {
try {
- const { data, error } = await supabase_service
+ const { data, error } = await supabase_rr_service
.from("eb-sync")
.select("team_id")
.eq("team_id", teamId)
diff --git a/apps/api/src/services/billing/auto_charge.ts b/apps/api/src/services/billing/auto_charge.ts
index ace14c6e3..b30be201d 100644
--- a/apps/api/src/services/billing/auto_charge.ts
+++ b/apps/api/src/services/billing/auto_charge.ts
@@ -2,7 +2,7 @@
import { AuthCreditUsageChunk } from "../../controllers/v1/types";
import { getACUC } from "../../controllers/auth";
import { redlock } from "../redlock";
-import { supabase_service } from "../supabase";
+import { supabase_rr_service, supabase_service } from "../supabase";
import { createPaymentIntent } from "./stripe";
import { issueCredits } from "./issue_credits";
import { sendNotification, sendNotificationWithCustomDays } from "../notification/email_notification";
@@ -124,7 +124,7 @@ export async function autoCharge(
if (chunk.sub_user_id) {
// Fetch the customer's Stripe information
const { data: customer, error: customersError } =
- await supabase_service
+ await supabase_rr_service
.from("customers")
.select("id, stripe_customer_id")
.eq("id", chunk.sub_user_id)
diff --git a/apps/api/src/services/webhook.ts b/apps/api/src/services/webhook.ts
index 75adfe761..6ba9649ac 100644
--- a/apps/api/src/services/webhook.ts
+++ b/apps/api/src/services/webhook.ts
@@ -1,6 +1,6 @@
import axios from "axios";
import { logger } from "../lib/logger";
-import { supabase_service } from "./supabase";
+import { supabase_rr_service, supabase_service } from "./supabase";
import { WebhookEventType } from "../types";
import { configDotenv } from "dotenv";
import { z } from "zod";
@@ -36,7 +36,7 @@ export const callWebhook = async (
// Only fetch the webhook URL from the database if the self-hosted webhook URL and specified webhook are not set
// and the USE_DB_AUTHENTICATION environment variable is set to true
if (!webhookUrl && useDbAuthentication) {
- const { data: webhooksData, error } = await supabase_service
+ const { data: webhooksData, error } = await supabase_rr_service
.from("webhooks")
.select("url")
.eq("team_id", teamId)