revert mog changes

This commit is contained in:
rafaelmmiller 2025-04-02 10:45:11 -03:00
parent 73a297d6c8
commit 7216799ca0
5 changed files with 9 additions and 8 deletions

View File

@ -97,7 +97,8 @@ export async function getACUC(
mode === RateLimiterMode.Extract ||
mode === RateLimiterMode.ExtractStatus;
while (retries < maxRetries) {
const client = supabase_service;
const client =
Math.random() > (2/3) ? supabase_rr_service : supabase_service;
({ data, error } = await client.rpc(
"auth_credit_usage_chunk_27_tally",
{ input_key: api_key, i_is_extract: isExtract, tally_untallied_credits: true },

View File

@ -246,7 +246,7 @@ export async function crawlStatusController(
let totalCount = jobIDs.length;
if (totalCount === 0 && process.env.USE_DB_AUTHENTICATION === "true") {
const x = await supabase_service
const x = await supabase_rr_service
.from('firecrawl_jobs')
.select('*', { count: 'exact', head: true })
.eq("crawl_id", req.params.jobId)

View File

@ -8,7 +8,7 @@ import * as Sentry from "@sentry/node";
* @returns {any | null} Job
*/
export const supabaseGetJobById = async (jobId: string) => {
const { data, error } = await supabase_service
const { data, error } = await supabase_rr_service
.from("firecrawl_jobs")
.select("*")
.eq("job_id", jobId)
@ -31,7 +31,7 @@ export const supabaseGetJobById = async (jobId: string) => {
* @returns {any[]} Jobs
*/
export const supabaseGetJobsById = async (jobIds: string[]) => {
const { data, error } = await supabase_service
const { data, error } = await supabase_rr_service
.from("firecrawl_jobs")
.select()
.in("job_id", jobIds);
@ -55,7 +55,7 @@ export const supabaseGetJobsById = async (jobIds: string[]) => {
* @returns {any[]} Jobs
*/
export const supabaseGetJobsByCrawlId = async (crawlId: string) => {
const { data, error } = await supabase_service
const { data, error } = await supabase_rr_service
.from("firecrawl_jobs")
.select()
.eq("crawl_id", crawlId);
@ -74,7 +74,7 @@ export const supabaseGetJobsByCrawlId = async (crawlId: string) => {
};
export const supabaseGetJobByIdOnlyData = async (jobId: string) => {
const { data, error } = await supabase_service
const { data, error } = await supabase_rr_service
.from("firecrawl_jobs")
.select("docs, team_id")
.eq("job_id", jobId)

View File

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

@ -18,7 +18,7 @@ export async function validateIdempotencyKey(req: Request): Promise<boolean> {
return false;
}
const { data, error } = await supabase_service
const { data, error } = await supabase_rr_service
.from("idempotency_keys")
.select("key")
.eq("key", idempotencyKey);