Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Implement membership withdrawal logic #140

Merged
merged 10 commits into from
Apr 25, 2022
Merged

Conversation

holmir97
Copy link
Member

🌈 PR 요약 / Linked Issue

회원탈퇴 Api 추가
User Scan 스케줄러 추가
close #137

📌 변경 사항

  • 회원탈퇴 Api 가 추가되었습니다.

  • 매일 자정 작동하는 스케줄러를 추가하였습니다.

  • 콘솔을 통해 스케줄러 동작을 로깅할 수 있습니다.

  • node-scheduler 모듈이 추가되었습니다.

✅ PR check list

1. 제목 양식 준수 확인

[feat] PR title

2. 테스트 코드 작동 스크린샷

npm run mocha

✅ After merge check list

1. 릴리즈 노트 변경

릴리즈 노트 To Do에서 Done으로 옮기기

2. 브랜치 삭제

@holmir97 holmir97 added 🍀 feature 새로운 기능 추가 1️⃣ priority: high 우선순위 높음 labels Apr 22, 2022
@holmir97 holmir97 added this to the v2.1.0 milestone Apr 22, 2022
@holmir97 holmir97 requested review from seohyun-106 and geeneve April 22, 2022 12:26
@holmir97 holmir97 self-assigned this Apr 22, 2022
Copy link
Member

@geeneve geeneve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스케쥴러 신기해요 고생하셧슴다~~!!

// library
import { keysToSnake, keysToCamel } from "../library/convertSnakeToCamel";

export const userScan = schedule.scheduleJob("0 0 0 * * *", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 0 0 * * *이 뭔지 궁금해요

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 궁금해요

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0초 0분 0시 매일 매달 매년
매 = *
로 이해하시면 될 것 같습니다

// 삭제 예정 유저
const deletedUsers = await User.find(keysToSnake({ isDeleted: true }));

deletedUsers.map(async (user) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 용도로 활용할때는 map 대신에 foreach가 좋을 듯~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반환값이 불필요하고, 속도가 foreach가 더 빠르다는 점에서 동근님의 의견이 맞는것 같슴다.
수정하겠습니다

// library
import { keysToSnake, keysToCamel } from "../library/convertSnakeToCamel";

export const userScan = schedule.scheduleJob("0 0 0 * * *", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 궁금해요

@holmir97 holmir97 merged commit e674770 into develop Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1️⃣ priority: high 우선순위 높음 🍀 feature 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Implement membership withdrawal logic
3 participants