2
0

🛂 Reset isQuarantined on the first of month

This commit is contained in:
Baptiste Arnaud
2023-04-23 21:07:46 +02:00
parent c6983c952c
commit 3fbd044d92
8 changed files with 54 additions and 239 deletions

View File

@@ -14,6 +14,7 @@ export const cleanDatabase = async () => {
if (isFirstOfMonth) {
await deleteArchivedResults()
await deleteArchivedTypebots()
await resetQuarantinedWorkspaces()
}
console.log('Done!')
}
@@ -118,4 +119,14 @@ const deleteExpiredVerificationTokens = async () => {
console.log(`Deleted ${count} expired verifiations tokens.`)
}
const resetQuarantinedWorkspaces = async () =>
prisma.workspace.updateMany({
where: {
isQuarantined: true,
},
data: {
isQuarantined: false,
},
})
cleanDatabase().then()