diff --git a/BE/src/stockSocket/stock-price-socket.service.ts b/BE/src/stockSocket/stock-price-socket.service.ts index 7da6b40..0c27ab2 100644 --- a/BE/src/stockSocket/stock-price-socket.service.ts +++ b/BE/src/stockSocket/stock-price-socket.service.ts @@ -27,9 +27,9 @@ export class StockPriceSocketService extends BaseStockSocketDomainService { async socketOpenHandler(): Promise { const orders: Order[] = await this.stockExecuteOrderRepository.findAllCodeByStatus(); - orders.forEach((order) => { - this.baseSocketDomainService.registerCode(this.TR_ID, order.stock_code); - }); + await Promise.all( + orders.map((order) => this.subscribeByCode(order.stock_code)), + ); } socketDataHandler(data: string[]) {