From 84fb8b07107a6f48df0357edeeb2d9ef6e8498ad Mon Sep 17 00:00:00 2001 From: lars Date: Thu, 12 Sep 2024 13:59:22 +0200 Subject: [PATCH] =?UTF-8?q?wenn=20ein=20Workspace=20die=20maximalen=20Chat?= =?UTF-8?q?s=20erreicht=20(ohne=20Karenz)=20hat=20werden=20die=20jewailige?= =?UTF-8?q?n=20bots=20offline=20geschlatet=20(Quarant=C3=A4ne)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/scripts/checkAndReportChatsUsage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/scripts/checkAndReportChatsUsage.ts b/packages/scripts/checkAndReportChatsUsage.ts index 14cbad1e5..7e4c6cce2 100644 --- a/packages/scripts/checkAndReportChatsUsage.ts +++ b/packages/scripts/checkAndReportChatsUsage.ts @@ -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}...`) await prisma.workspace.updateMany({ where: { id: workspace.id },