wenn ein Workspace die maximalen Chats erreicht (ohne Karenz) hat werden die jewailigen bots offline geschlatet (Quarantäne)
This commit is contained in:
@ -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 },
|
||||||
|
Reference in New Issue
Block a user