diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-18 14:44:12 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-02-19 09:36:50 +0100 |
commit | fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8 (patch) | |
tree | 38df5942cb2fa6e5860c8e0e19471eb6b124e291 /server/controllers/api/users | |
parent | 3f8ae0e4e4da90c964597e4b3e0724da5eaa1668 (diff) | |
download | PeerTube-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.ts | 5 |
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 | ||