Skip to content

Commit 19116a6

Browse files
committed
docs(content): fix e2e socket.io-redis tests for multiple app instances
Fixes multiple app instances in e2e tests not connecting properly to socket.io-redis by reinitialising redisIOAdapter on createIOServer.
1 parent d7d0640 commit 19116a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/websockets/adapter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Once the package is installed, we can create a `RedisIoAdapter` class.
3939
import { IoAdapter } from '@nestjs/platform-socket.io';
4040
import redisIoAdapter from 'socket.io-redis';
4141

42-
const redisAdapter = redisIoAdapter({ host: 'localhost', port: 6379 });
43-
4442
export class RedisIoAdapter extends IoAdapter {
4543
createIOServer(port: number, options?: any): any {
4644
const server = super.createIOServer(port, options);
45+
const redisAdapter = redisIoAdapter({ host: 'localhost', port: 6379 });
46+
4747
server.adapter(redisAdapter);
4848
return server;
4949
}

0 commit comments

Comments
 (0)