mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Nick: debug the billing email system for free credits
This commit is contained in:
parent
6ccc22ba2f
commit
7561fd279f
|
@ -255,7 +255,9 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) {
|
|||
const creditLimit = FREE_CREDITS;
|
||||
const creditUsagePercentage = (totalCreditsUsed + credits) / creditLimit;
|
||||
|
||||
if (creditUsagePercentage >= 0.8) {
|
||||
// Add a check to ensure totalCreditsUsed is greater than 0
|
||||
if (totalCreditsUsed > 0 && creditUsagePercentage >= 0.8 && creditUsagePercentage < 1) {
|
||||
Logger.info(`Sending notification for team ${team_id}. Total credits used: ${totalCreditsUsed}, Credit usage percentage: ${creditUsagePercentage}`);
|
||||
await sendNotification(
|
||||
team_id,
|
||||
NotificationType.APPROACHING_LIMIT,
|
||||
|
|
Loading…
Reference in New Issue
Block a user