Nick: more read replicas

This commit is contained in:
Nicolas 2025-03-06 17:45:51 -03:00
parent 949fb68bdd
commit 783fad90dd
3 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)