From e65ef81cf51746616182a822bd6933bf0d16717a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Feb 2023 11:56:58 +0100 Subject: Update server dependencies --- server/controllers/api/jobs.ts | 6 +++--- server/controllers/api/users/index.ts | 2 +- server/controllers/api/users/my-subscriptions.ts | 4 +++- server/helpers/custom-validators/logs.ts | 4 ++-- server/lib/activitypub/actors/updater.ts | 2 +- server/lib/stat-manager.ts | 2 +- server/middlewares/cache/shared/api-cache.ts | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) (limited to 'server') 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', jobsRouter.post('/resume', authenticate, ensureUserHasRight(UserRight.MANAGE_JOBS), - asyncMiddleware(resumeJobQueue) + resumeJobQueue ) jobsRouter.get('/:state?', @@ -55,8 +55,8 @@ async function pauseJobQueue (req: express.Request, res: express.Response) { return res.sendStatus(HttpStatusCode.NO_CONTENT_204) } -async function resumeJobQueue (req: express.Request, res: express.Response) { - await JobQueue.Instance.resume() +function resumeJobQueue (req: express.Request, res: express.Response) { + JobQueue.Instance.resume() return res.sendStatus(HttpStatusCode.NO_CONTENT_204) } 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 await user.save({ transaction: t }) }) - await Emailer.Instance.addUserBlockJob(user, block, reason) + Emailer.Instance.addUserBlockJob(user, block, reason) auditLogger.update(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()), oldUserAuditView) } 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 const subscription = res.locals.subscription await sequelizeTypescript.transaction(async t => { - if (subscription.state === 'accepted') await sendUndoFollow(subscription, t) + if (subscription.state === 'accepted') { + sendUndoFollow(subscription, t) + } return subscription.destroy({ transaction: t }) }) 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' import { ClientLogLevel, ServerLogLevel } from '@shared/models' import { exists } from './misc' -const serverLogLevels: Set = new Set([ 'debug', 'info', 'warn', 'error' ]) -const clientLogLevels: Set = new Set([ 'warn', 'error' ]) +const serverLogLevels = new Set([ 'debug', 'info', 'warn', 'error' ]) +const clientLogLevels = new Set([ 'warn', 'error' ]) function isValidLogLevel (value: any) { 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' export class APActorUpdater { - private accountOrChannel: MAccount | MChannel + private readonly accountOrChannel: MAccount | MChannel constructor ( 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 { private readonly instanceStartDate = new Date() - private inboxMessages = { + private readonly inboxMessages = { processed: 0, errors: 0, 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 { private readonly options: APICacheOptions private readonly timers: { [ id: string ]: NodeJS.Timeout } = {} - private index: { all: string[] } = { all: [] } + private readonly index: { all: string[] } = { all: [] } constructor (options: APICacheOptions) { this.options = { -- cgit v1.2.3