diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/api/jobs.ts | 6 | ||||
-rw-r--r-- | server/controllers/api/users/index.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/users/my-subscriptions.ts | 4 | ||||
-rw-r--r-- | server/helpers/custom-validators/logs.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/actors/updater.ts | 2 | ||||
-rw-r--r-- | server/lib/stat-manager.ts | 2 | ||||
-rw-r--r-- | server/middlewares/cache/shared/api-cache.ts | 2 |
7 files changed, 12 insertions, 10 deletions
diff --git a/server/controllers/api/jobs.ts b/server/controllers/api/jobs.ts index 0a45c33ab..6a53e3083 100644 --- a/server/controllers/api/jobs.ts +++ b/server/controllers/api/jobs.ts | |||
@@ -26,7 +26,7 @@ jobsRouter.post('/pause', | |||
26 | jobsRouter.post('/resume', | 26 | jobsRouter.post('/resume', |
27 | authenticate, | 27 | authenticate, |
28 | ensureUserHasRight(UserRight.MANAGE_JOBS), | 28 | ensureUserHasRight(UserRight.MANAGE_JOBS), |
29 | asyncMiddleware(resumeJobQueue) | 29 | resumeJobQueue |
30 | ) | 30 | ) |
31 | 31 | ||
32 | jobsRouter.get('/:state?', | 32 | jobsRouter.get('/:state?', |
@@ -55,8 +55,8 @@ async function pauseJobQueue (req: express.Request, res: express.Response) { | |||
55 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) | 55 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
56 | } | 56 | } |
57 | 57 | ||
58 | async function resumeJobQueue (req: express.Request, res: express.Response) { | 58 | function resumeJobQueue (req: express.Request, res: express.Response) { |
59 | await JobQueue.Instance.resume() | 59 | JobQueue.Instance.resume() |
60 | 60 | ||
61 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) | 61 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
62 | } | 62 | } |
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 5a5a12e82..96366d68c 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -309,7 +309,7 @@ async function changeUserBlock (res: express.Response, user: MUserAccountDefault | |||
309 | await user.save({ transaction: t }) | 309 | await user.save({ transaction: t }) |
310 | }) | 310 | }) |
311 | 311 | ||
312 | await Emailer.Instance.addUserBlockJob(user, block, reason) | 312 | Emailer.Instance.addUserBlockJob(user, block, reason) |
313 | 313 | ||
314 | auditLogger.update(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()), oldUserAuditView) | 314 | auditLogger.update(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()), oldUserAuditView) |
315 | } | 315 | } |
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts index a750f9bd1..6c64e99a7 100644 --- a/server/controllers/api/users/my-subscriptions.ts +++ b/server/controllers/api/users/my-subscriptions.ts | |||
@@ -138,7 +138,9 @@ async function deleteUserSubscription (req: express.Request, res: express.Respon | |||
138 | const subscription = res.locals.subscription | 138 | const subscription = res.locals.subscription |
139 | 139 | ||
140 | await sequelizeTypescript.transaction(async t => { | 140 | await sequelizeTypescript.transaction(async t => { |
141 | if (subscription.state === 'accepted') await sendUndoFollow(subscription, t) | 141 | if (subscription.state === 'accepted') { |
142 | sendUndoFollow(subscription, t) | ||
143 | } | ||
142 | 144 | ||
143 | return subscription.destroy({ transaction: t }) | 145 | return subscription.destroy({ transaction: t }) |
144 | }) | 146 | }) |
diff --git a/server/helpers/custom-validators/logs.ts b/server/helpers/custom-validators/logs.ts index 41d45cbb2..215dbb0e1 100644 --- a/server/helpers/custom-validators/logs.ts +++ b/server/helpers/custom-validators/logs.ts | |||
@@ -3,8 +3,8 @@ import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' | |||
3 | import { ClientLogLevel, ServerLogLevel } from '@shared/models' | 3 | import { ClientLogLevel, ServerLogLevel } from '@shared/models' |
4 | import { exists } from './misc' | 4 | import { exists } from './misc' |
5 | 5 | ||
6 | const serverLogLevels: Set<ServerLogLevel> = new Set([ 'debug', 'info', 'warn', 'error' ]) | 6 | const serverLogLevels = new Set<ServerLogLevel>([ 'debug', 'info', 'warn', 'error' ]) |
7 | const clientLogLevels: Set<ClientLogLevel> = new Set([ 'warn', 'error' ]) | 7 | const clientLogLevels = new Set<ClientLogLevel>([ 'warn', 'error' ]) |
8 | 8 | ||
9 | function isValidLogLevel (value: any) { | 9 | function isValidLogLevel (value: any) { |
10 | return exists(value) && serverLogLevels.has(value) | 10 | return exists(value) && serverLogLevels.has(value) |
diff --git a/server/lib/activitypub/actors/updater.ts b/server/lib/activitypub/actors/updater.ts index 137980460..73bdf1edc 100644 --- a/server/lib/activitypub/actors/updater.ts +++ b/server/lib/activitypub/actors/updater.ts | |||
@@ -11,7 +11,7 @@ import { getImagesInfoFromObject } from './shared/object-to-model-attributes' | |||
11 | 11 | ||
12 | export class APActorUpdater { | 12 | export class APActorUpdater { |
13 | 13 | ||
14 | private accountOrChannel: MAccount | MChannel | 14 | private readonly accountOrChannel: MAccount | MChannel |
15 | 15 | ||
16 | constructor ( | 16 | constructor ( |
17 | private readonly actorObject: ActivityPubActor, | 17 | private readonly actorObject: ActivityPubActor, |
diff --git a/server/lib/stat-manager.ts b/server/lib/stat-manager.ts index 03063793d..0516e7f1a 100644 --- a/server/lib/stat-manager.ts +++ b/server/lib/stat-manager.ts | |||
@@ -16,7 +16,7 @@ class StatsManager { | |||
16 | 16 | ||
17 | private readonly instanceStartDate = new Date() | 17 | private readonly instanceStartDate = new Date() |
18 | 18 | ||
19 | private inboxMessages = { | 19 | private readonly inboxMessages = { |
20 | processed: 0, | 20 | processed: 0, |
21 | errors: 0, | 21 | errors: 0, |
22 | successes: 0, | 22 | successes: 0, |
diff --git a/server/middlewares/cache/shared/api-cache.ts b/server/middlewares/cache/shared/api-cache.ts index 9e15bf2d6..7c366db00 100644 --- a/server/middlewares/cache/shared/api-cache.ts +++ b/server/middlewares/cache/shared/api-cache.ts | |||
@@ -27,7 +27,7 @@ export class ApiCache { | |||
27 | private readonly options: APICacheOptions | 27 | private readonly options: APICacheOptions |
28 | private readonly timers: { [ id: string ]: NodeJS.Timeout } = {} | 28 | private readonly timers: { [ id: string ]: NodeJS.Timeout } = {} |
29 | 29 | ||
30 | private index: { all: string[] } = { all: [] } | 30 | private readonly index: { all: string[] } = { all: [] } |
31 | 31 | ||
32 | constructor (options: APICacheOptions) { | 32 | constructor (options: APICacheOptions) { |
33 | this.options = { | 33 | this.options = { |