Skip to content

Commit

Permalink
fix: 팔로우 리스트 반환 문제 해결
Browse files Browse the repository at this point in the history
팔로우 리스트를 반환할 때 forEach를 사용하면 async를 대기하지 않는
문제가 있어, forEach를 for문으로 변경하였습니다.
  • Loading branch information
JYKIM317 committed Dec 4, 2024
1 parent 99ba526 commit 6d25cc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions applicationServer/src/live/live.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export class LiveService {
const followList = await this.memberService.findMembersWithFollowTable(memberId);
const onAir = [];
const offAir = [];
followList.forEach(async (member) => {

for (const member of followList) {
if (live.has(member.broadcast_id)) {
onAir.push(await this.responseLiveData(member.broadcast_id));
} else {
Expand All @@ -174,7 +175,7 @@ export class LiveService {
follower_count,
} as User);
}
});
}

return {
onAir,
Expand Down

0 comments on commit 6d25cc8

Please sign in to comment.