Skip to content

Commit

Permalink
[FIX] 캐라서비스 종료 안내 푸시알림
Browse files Browse the repository at this point in the history
  • Loading branch information
leGit-y committed Nov 1, 2024
1 parent bff680f commit 3758a5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/controller/alarmController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -42,7 +42,7 @@ const serviceEndAlarm = async () => {
"deviceToken": token
}

pushAlarmWithPayload(data);
await pushAlarmWithPayload(data);

}

Expand Down Expand Up @@ -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;

Expand All @@ -209,7 +209,7 @@ const pushAlarmWithPayload = (data: any) => {
}
}

admin
await admin
.messaging()
.send(message)
.then(function (response: Response) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions src/service/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 3758a5f

Please sign in to comment.