From 9339a417944b67382483e2c85e3136f87f618ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8A=E3=81=95=E3=82=80=E3=81=AE=E3=81=B2=E3=81=A8?= <46447427+samunohito@users.noreply.github.com> Date: Fri, 11 Oct 2024 06:26:24 +0900 Subject: [PATCH] fix --- .../CheckModeratorsActivityProcessorService.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts b/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts index 3a9864b215..9d1d11921f 100644 --- a/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts +++ b/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts @@ -48,7 +48,7 @@ export class CheckModeratorsActivityProcessorService { await this.changeToInvitationOnly(); } else { if (inactivityLimitCountdown <= 2) { - this.logger.info(`A moderator has been inactive for a period of time. If you are inactive for an additional ${inactivityLimitCountdown} days, it will switch to invitation only.`); + this.logger.warn(`A moderator has been inactive for a period of time. If you are inactive for an additional ${inactivityLimitCountdown} days, it will switch to invitation only.`); } } } @@ -88,7 +88,11 @@ export class CheckModeratorsActivityProcessorService { inactivePeriod.setDate(today.getDate() - MODERATOR_INACTIVITY_LIMIT_DAYS); // TODO: モデレーター以外にも特別な権限を持つユーザーがいる場合は考慮する - const moderators = await this.roleService.getModerators(true, true); + const moderators = await this.roleService.getModerators({ + includeAdmins: true, + includeRoot: true, + excludeExpire: true, + }); const inactiveModeratorCount = moderators .map(it => it.lastActiveDate) .filter(it => it != null) @@ -103,8 +107,6 @@ export class CheckModeratorsActivityProcessorService { @bindThis public async changeToInvitationOnly() { - const meta = await this.metaService.fetch(true); - meta.disableRegistration = true; - await this.metaService.update(meta); + await this.metaService.update({ disableRegistration: true }); } }