fix(auto_charge): fix ACUC clear (#1571)

This commit is contained in:
Gergő Móricz 2025-05-20 00:38:20 +02:00 committed by GitHub
parent 192d056bef
commit d8405de89d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
// Import necessary dependencies and types
import { AuthCreditUsageChunk } from "../../controllers/v1/types";
import { getACUC } from "../../controllers/auth";
import { clearACUC, clearACUCTeam, getACUC } from "../../controllers/auth";
import { redlock } from "../redlock";
import { supabase_rr_service, supabase_service } from "../supabase";
import { createPaymentIntent } from "./stripe";
@ -210,8 +210,8 @@ export async function autoCharge(
);
// Reset ACUC cache to reflect the new credit balance
const cacheKeyACUC = `acuc_${chunk.api_key}`;
await deleteKey(cacheKeyACUC);
await clearACUC(chunk.api_key);
await clearACUCTeam(chunk.team_id);
if (process.env.SLACK_ADMIN_WEBHOOK_URL) {
const webhookCooldownKey = `webhook_cooldown_${chunk.team_id}`;