2
0

wenn ein Workspace die maximalen Chats erreicht (ohne Karenz) hat werden die jewailigen bots offline geschlatet (Quarantäne)

This commit is contained in:
2024-09-12 13:59:22 +02:00
parent 589b776acb
commit 84fb8b0710

View File

@ -161,7 +161,9 @@ export const checkAndReportChatsUsage = async () => {
} }
} }
if (totalChatsUsed > chatsLimit * 1.5 && workspace.plan === Plan.FREE) { // if (totalChatsUsed > chatsLimit * 1.5 && workspace.plan === Plan.FREE) { //hä ist der Chatlimit mal 1,5?
if (totalChatsUsed > chatsLimit &&
(workspace.plan === Plan.FREE || workspace.plan === Plan.STARTER || workspace.plan === Plan.PRO || workspace.plan === Plan.CUSTOM)) { //ich hab den faktor entfernt und es für den Plan FREE, STARTER, PRO und CUSTOM gesetzt, sodass bei erreichen des Limits der Bot offline geschlatet wird (quarantäne)
console.log(`Automatically quarantine workspace ${workspace.id}...`) console.log(`Automatically quarantine workspace ${workspace.id}...`)
await prisma.workspace.updateMany({ await prisma.workspace.updateMany({
where: { id: workspace.id }, where: { id: workspace.id },