aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-18 14:44:12 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-19 09:36:50 +0100
commitfae6e4da8f516a9d6c3bad9bf6f35811ccacbad8 (patch)
tree38df5942cb2fa6e5860c8e0e19471eb6b124e291 /server/controllers/api/users
parent3f8ae0e4e4da90c964597e4b3e0724da5eaa1668 (diff)
downloadPeerTube-fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8.tar.gz
PeerTube-fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8.tar.zst
PeerTube-fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8.zip
Try to speed up server tests
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r--server/controllers/api/users/index.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index 5911d1a0f..fa0688a9e 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -307,7 +307,10 @@ async function removeUser (req: express.Request, res: express.Response) {
307 307
308 auditLogger.delete(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) 308 auditLogger.delete(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()))
309 309
310 await user.destroy() 310 await sequelizeTypescript.transaction(async t => {
311 // Use a transaction to avoid inconsistencies with hooks (account/channel deletion & federation)
312 await user.destroy({ transaction: t })
313 })
311 314
312 Hooks.runAction('action:api.user.deleted', { user }) 315 Hooks.runAction('action:api.user.deleted', { user })
313 316