Skip to content

Commit 8248686

Browse files
committed
fix: websocket server
1 parent 9751bc4 commit 8248686

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docker-compose.prod.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ services:
6363
- REDIS_PASSWORD=${REDIS_PASSWORD}
6464
- REDIS_HOST=${REDIS_HOST}
6565
- REDIS_PORT=${REDIS_PORT}
66-
- SERVER_ID=room1
66+
67+
# WebSocket 서버 세팅
68+
- SERVER_ID=${WS1_SERVER}
6769
- WS_PORT=${WS1_PORT}
6870
networks:
6971
- app-network
@@ -96,7 +98,8 @@ services:
9698
- REDIS_PASSWORD=${REDIS_PASSWORD}
9799
- REDIS_HOST=${REDIS_HOST}
98100
- REDIS_PORT=${REDIS_PORT}
99-
- SERVER_ID=room2
101+
# WebSocket 세팅
102+
- SERVER_ID=${WS2_SERVER}
100103
- WS_PORT=${WS2_PORT}
101104
networks:
102105
- app-network

packages/collaborative/src/redis/redis.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class RedisService implements OnModuleInit, OnModuleDestroy {
2727
}
2828

2929
async updateRedisConnection(urlId: string, action: 'add' | 'remove') {
30-
const serverId = process.env.SERVER_ID || 'default-server';
30+
const serverId = process.env.SERVER_ID;
3131
const key = `ws:connection:${urlId}`;
3232
const existingData = await this.client.get(key);
3333

@@ -47,7 +47,7 @@ export class RedisService implements OnModuleInit, OnModuleDestroy {
4747

4848
@Cron('*/10 * * * * *')
4949
async cronSystemMetrics() {
50-
const serverId = process.env.SERVER_ID || 'default-server';
50+
const serverId = process.env.SERVER_ID;
5151
const key = `server:system:metrics`;
5252

5353
try {

0 commit comments

Comments
 (0)