fix(quotas): unifier le décompte IA (BYOK, rollback) et combler les fuites
Centralise la réserve via ai-quota, corrige admin unavailable (-1), brancher les routes sans quota et le host-pays brainstorm, avec usage-meter élargi, noms de clusters, MCP et ajustements dashboard/insights. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -77,12 +77,12 @@ export async function POST(req: NextRequest) {
|
||||
redis.get(`${key}:tokens`),
|
||||
]);
|
||||
|
||||
const periodStart = new Date(`${period}-01`);
|
||||
const periodEnd = new Date(
|
||||
periodStart.getFullYear(),
|
||||
periodStart.getMonth() + 1,
|
||||
const periodStart = new Date(`${period}-01T00:00:00.000Z`);
|
||||
const periodEnd = new Date(Date.UTC(
|
||||
periodStart.getUTCFullYear(),
|
||||
periodStart.getUTCMonth() + 1,
|
||||
1,
|
||||
);
|
||||
));
|
||||
|
||||
await prisma.usageLog.upsert({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user