diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/server/debug.ts | 6 | ||||
-rw-r--r-- | server/controllers/api/users/index.ts | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/server/controllers/api/server/debug.ts b/server/controllers/api/server/debug.ts index e12fc1dd4..7787186be 100644 --- a/server/controllers/api/server/debug.ts +++ b/server/controllers/api/server/debug.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | import { InboxManager } from '@server/lib/activitypub/inbox-manager' | ||
1 | import * as express from 'express' | 2 | import * as express from 'express' |
2 | import { UserRight } from '../../../../shared/models/users' | 3 | import { UserRight } from '../../../../shared/models/users' |
3 | import { authenticate, ensureUserHasRight } from '../../../middlewares' | 4 | import { authenticate, ensureUserHasRight } from '../../../middlewares' |
@@ -20,6 +21,7 @@ export { | |||
20 | 21 | ||
21 | function getDebug (req: express.Request, res: express.Response) { | 22 | function getDebug (req: express.Request, res: express.Response) { |
22 | return res.json({ | 23 | return res.json({ |
23 | ip: req.ip | 24 | ip: req.ip, |
24 | }).end() | 25 | activityPubMessagesWaiting: InboxManager.Instance.getActivityPubMessagesWaiting() |
26 | }) | ||
25 | } | 27 | } |
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 | ||