feat(microservices): migrate redis transporter to internally use ioredis package

This commit is contained in:
Kamil Myśliwiec
2021-12-16 14:20:42 +01:00
parent 61bcb7fe39
commit 40e2755c82
9 changed files with 305 additions and 499 deletions

View File

@@ -34,7 +34,7 @@ describe('Disconnected client', () => {
.send({
transport: Transport.REDIS,
options: {
url: 'redis://localhost:3333',
port: '3333',
},
})
.expect(408);

View File

@@ -3,7 +3,7 @@ import {
Controller,
InternalServerErrorException,
Post,
RequestTimeoutException,
RequestTimeoutException
} from '@nestjs/common';
import { ClientProxyFactory } from '@nestjs/microservices';
import { Observable, throwError } from 'rxjs';
@@ -24,7 +24,8 @@ export class DisconnectedClientController {
return throwError(() =>
code === 'ECONNREFUSED' ||
code === 'CONN_ERR' ||
code === 'CONNECTION_REFUSED'
code === 'CONNECTION_REFUSED' ||
error.message === 'Connection is closed.'
? new RequestTimeoutException('ECONNREFUSED')
: new InternalServerErrorException(),
);