-
Notifications
You must be signed in to change notification settings - Fork 1
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
#573 2025 봄 이벤트 간접 초대 기능 추가 #574
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 성능 개선의 여지가 있을 것 같아서 코멘트 하나 남겨두었습니다..!
src/lottery/services/globalState.js
Outdated
let currentInviter = inviterStatus; | ||
while (currentInviter?.inviter) { | ||
const higherInviter = await eventStatusModel | ||
.findOne({ userId: currentInviter.inviter }) | ||
.lean(); | ||
if (!higherInviter) break; | ||
|
||
await contracts.completeIndirectEventSharingQuest( | ||
higherInviter.userId, | ||
req.timestamp | ||
); | ||
currentInviter = higherInviter; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ancestor들의 object id를 먼저 다 구해서 배열에 저장하고, Promise.all
을 이용해서 일괄적으로 퀘스트 완료 처리를 하면 어떨까요? completeQuest
내부에서 DB에 자주 접근해서, 이렇게 순차적으로 처리하면 성능 병목이 발생할 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary
다단계 시스템을 추가했습니다
It closes #573