nestjs / terminus

Terminus module for Nest framework (node.js) :robot:

Home Page:https://nestjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample code for Redis healthcheck does not work

soracha opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Sample code for Redis healthcheck in 002-microservice-app always return status down even I can connect the server via Redis GUI

Minimum reproduction code

return this.health.check([
      async () =>
        this.microservice.pingCheck(`redis`, {
          transport: Transport.REDIS,
          options: {
            host: REDIS_HOST,
            port: REDIS_PORT,
          },
        }),
    ]);

The result

{
    "status": "error",
    "info": {},
    "error": {
        "redis": {
            "status": "down",
            "message": "Connection is closed."
        }
    },
    "details": {
        "redis": {
            "status": "down",
            "message": "Connection is closed."
        }
    }
}

Steps to reproduce

No response

Expected behavior

Return Redis server status as it is

Package version

9.00

NestJS version

8.4.6

Node.js version

16.14.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

I have run the 002-microservice-app, and only change the Redis port to 6379. the Redis status is up. could you provide more context?

see this PR: #1954

We should go with 6379 since that is the default port and the one we use in our docker-compose.yml file as well.