Init commit
This commit is contained in:
9
server/core/models/shared/delete.ts
Normal file
9
server/core/models/shared/delete.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { MAX_SQL_DELETE_ITEMS } from '@server/initializers/constants.js'
|
||||
|
||||
export async function safeBulkDestroy (destroyFn: () => Promise<number>) {
|
||||
const destroyedRows = await destroyFn()
|
||||
|
||||
if (destroyedRows === MAX_SQL_DELETE_ITEMS) {
|
||||
return safeBulkDestroy(destroyFn)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user