From c56c88845d1787580cfe68b60f9d64223562a428 Mon Sep 17 00:00:00 2001 From: JYKIM317 Date: Fri, 6 Dec 2024 01:02:51 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B2=80=EC=83=89=20=EB=A9=A4=EB=B2=84?= =?UTF-8?q?=20=EB=B0=98=ED=99=98=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit forEach가 await을 대기하지 않아 멤버가 반환되지 않는 문제를 해결하였습니다. --- applicationServer/src/search/search.controller.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/applicationServer/src/search/search.controller.ts b/applicationServer/src/search/search.controller.ts index 9e706d2..1d7fafd 100644 --- a/applicationServer/src/search/search.controller.ts +++ b/applicationServer/src/search/search.controller.ts @@ -22,9 +22,11 @@ export class SearchController { await Promise.all([ (searchResult.lives = await this.searchService.getLiveListWithKeyword(keyword)), - (await this.searchService.getMemberListWithKeyword(keyword)).forEach(async (thisUser) => { - if (await this.redisService.exists(`${REDIS_LIVE_KEY}${thisUser.broadcast_id}`)) - searchResult.members.push(thisUser); + this.searchService.getMemberListWithKeyword(keyword).then(async (result) => { + for (const thisUser of result) { + if (!(await this.redisService.exists(`${REDIS_LIVE_KEY}${thisUser.broadcast_id}`))) + searchResult.members.push(thisUser); + } }), ]);