Redis Configuration

In addition tohost,port, anddb, you can pass any options supported by the node redis client createClientmethod.

The exception to this isretry_strategy, which takes a function argument inredis.createClient. Hydra provides a retry_strategy (hydra._redisRetryStrategy), which is configured via thehydra.redis.retry_strategyoption rather than being passed directly toredis.createClient:

  redis: {
    host: "127.0.0.1",
    port: 6379,
    db: 15,
    retry_strategy: {
      maxReconnectionPeriod: 15,
      maxDelayBetweenReconnections: 5
    }
  }

You also have the option of using theurlparameter instead ofhost,port,db, andpassword. See the IANA registration for details. The following is equivalent to the above host/port/db:

redis: {
  url: 'redis://127.0.0.1:6379/15'
}

Note: If you pass in _both _a URLand some combination ofhost,port,db, andpassword, the values inurlwill be overridden by the more specific entries:

redis: {
  url: 'redis://127.0.0.1:6379/15',
  db: 10
}

This will connect to database10instead of database15.

results matching ""

    No results matching ""