From 3758a5fe7b174d82969a111e143c41ef01d1f1b8 Mon Sep 17 00:00:00 2001 From: yelin Date: Fri, 1 Nov 2024 14:33:58 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=EC=BA=90=EB=9D=BC=EC=84=9C=EB=B9=84?= =?UTF-8?q?=EC=8A=A4=20=EC=A2=85=EB=A3=8C=20=EC=95=88=EB=82=B4=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=EC=95=8C=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controller/alarmController.ts | 8 ++++---- src/modules/scheduler.ts | 4 ++-- src/service/userService.ts | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/controller/alarmController.ts b/src/controller/alarmController.ts index 28c5451..74144b7 100644 --- a/src/controller/alarmController.ts +++ b/src/controller/alarmController.ts @@ -19,7 +19,7 @@ const serviceEndAlarm = async () => { const msg = ["안녕하세요, 캐라(Kaera) 서비스가 2024년 11월 11일 종료됩니다. 데이터는 종료 후 2개월간 보관되며 이후에는 완전히 파기될 예정입니다. 그동안 캐라(Kaera)를 사랑해 주셔서 감사합니다."] const contents = "안녕하세요, 캐라(Kaera) 서비스가 2024년 11월 11일 종료됩니다. 데이터는 종료 후 2개월간 보관되며 이후에는 완전히 파기될 예정입니다. 감사합니다." - for (let i = 0; i < userIds.length; i++) { + for (let i = 20; i < userIds.length; i++) { const worryCreateDTO: worryCreateDTO = { templateId: 1, userId: userIds[i], @@ -42,7 +42,7 @@ const serviceEndAlarm = async () => { "deviceToken": token } - pushAlarmWithPayload(data); + await pushAlarmWithPayload(data); } @@ -193,7 +193,7 @@ const pushAlarm = (data: any, next: NextFunction) => { } -const pushAlarmWithPayload = (data: any) => { +const pushAlarmWithPayload = async(data: any) => { try { const { payload, deviceToken, title, contents } = data; @@ -209,7 +209,7 @@ const pushAlarmWithPayload = (data: any) => { } } - admin + await admin .messaging() .send(message) .then(function (response: Response) { diff --git a/src/modules/scheduler.ts b/src/modules/scheduler.ts index 586b9e4..1808e78 100644 --- a/src/modules/scheduler.ts +++ b/src/modules/scheduler.ts @@ -13,8 +13,8 @@ const deadline_alarm_2 = cron.schedule('00 20 * * *', alarmController.setNoDeadl // 데드라인 당일 알람 : 낮 12시 const deadline_alarm_3 = cron.schedule('00 12 * * *', alarmController.setOnDeadlineAlarm, option); -// 2024-11-1 낮 2시에 종료 알림 -const service_end_alarm = cron.schedule('00 14 1 11 *', alarmController.serviceEndAlarm, option); +// 2024-11-1 낮 3시에 종료 알림 +const service_end_alarm = cron.schedule('00 15 1 11 *', alarmController.serviceEndAlarm, option); export default{ diff --git a/src/service/userService.ts b/src/service/userService.ts index 2c3c257..a6bbf7e 100644 --- a/src/service/userService.ts +++ b/src/service/userService.ts @@ -45,6 +45,7 @@ const deleteUser = async (userId: number) => { const getAllUser = async () => { const users = await userRepository.findAllUser(); + console.log(users) if(!users) throw new ClientException("delete user fail");