Skip to content

Commit

Permalink
Fix: web-push 알림전송 실패되는 토큰은 DB 에서 제거하도록 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
pp449 committed Sep 26, 2023
1 parent 172863d commit 1908cf7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/apis/subscribe/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export const pushNotification = (major: string): Promise<number> => {
);
} catch (error) {
notificationToSlack(error);
const deleteQuery = `DELETE FROM ${major}구독 WHERE user = ?`;
db.query(deleteQuery, [userInfo.user], (deleteErr) => {
if (deleteErr)
notificationToSlack('알림 보낼 수 없는 토큰 삭제 실패');
else console.log('알림 보낼 수 없는 토큰 삭제');
});
}
resolve(res.length);

Expand Down

0 comments on commit 1908cf7

Please sign in to comment.