Redis module for Nest framework (node.js). Support node-redis & ioredis.
MIT License
Bot releases are visible (Hide)
Published by liaoliaots over 2 years ago
redis-errors
from dependencies, use custom errors instead of ittest.ts
NOTE: This version is deprecated.
Published by liaoliaots over 2 years ago
0
when using memoryThreshold
Published by liaoliaots over 2 years ago
Published by liaoliaots over 2 years ago
remove exports for RedisStatus
and ClusterStatus
, those should be used internally (#189) (531af150efc4a06e032479123e173650c374bca9)
change default namespace from Symbol('default')
to 'default'
for best readability of the logs. Please note that you shouldn't have multiple client without a namespace, or with the same namespace, otherwise they will get overridden. (#189) (3849b488b3076ead01b9269158ccbc24eb3bacc0)
export const DEFAULT_REDIS_NAMESPACE = 'default'; // redis
export const DEFAULT_CLUSTER_NAMESPACE = 'default'; // cluster
instanceof
to prevent some bugs in realms environment (#189) (08d7ede4baed69090e1e152c6fd2573bcd68297d)isGlobal
option as the second param to control whether the module is global-scoped and set its default value to true
(#189) (617d204689398fa2e3ca7408864ffd84536b2429)// redis
static forRoot(options: RedisModuleOptions = {}, isGlobal = true): DynamicModule;
static forRootAsync(options: RedisModuleAsyncOptions, isGlobal = true): DynamicModule;
// cluster
static forRoot(options: ClusterModuleOptions, isGlobal = true): DynamicModule;
static forRootAsync(options: ClusterModuleAsyncOptions, isGlobal = true): DynamicModule;
checkHealth
Published by liaoliaots almost 3 years ago
RedisService
, this is an alias for RedisManager
ClusterService
, this is an alias for ClusterManager
quitClients
logic, remove unnecessary async/awaitPublished by liaoliaots almost 3 years ago
From version 5.1.1, the release information follows the keep a changelog format to maintain a human readable changelog.
PromiseSettledResult
, use polyfill instead of itPublished by liaoliaots almost 3 years ago
Published by liaoliaots almost 3 years ago
Published by liaoliaots about 3 years ago
config
option.If your redis server does not have a password, the host is 127.0.0.1 and the port is 6379:
The default redis client will be created if you do not specify the config
option:
import { Module } from '@nestjs/common';
import { RedisModule } from '@liaoliaots/nestjs-redis';
@Module({
imports: [RedisModule.forRoot()]
})
export class AppModule {}
The default redis client will not be created if you do not specify the config
option, so you have to specify the config
option:
import { Module } from '@nestjs/common';
import { RedisModule } from '@liaoliaots/nestjs-redis';
@Module({
imports: [RedisModule.forRoot({ closeClient: true, config: { host: '127.0.0.1', port: 6379 } })]
})
export class AppModule {}
Published by liaoliaots about 3 years ago
Published by liaoliaots about 3 years ago
useFactory
(#129)Published by liaoliaots about 3 years ago
config
option to object (#128)Published by liaoliaots about 3 years ago
extraProviders
async optionRedisStatus
and ClusterStatus
for some use casesPublished by liaoliaots about 3 years ago
Published by liaoliaots about 3 years ago
RedisService
to RedisManager
for better semantics, no other changes (#110)ClusterService
to ClusterManager
for better semantics, no other changes (#110)import { RedisService, ClusterService } from '@liaoliaots/nestjs-redis';
import { RedisManager, ClusterManager } from '@liaoliaots/nestjs-redis';
Published by liaoliaots about 3 years ago
Published by liaoliaots about 3 years ago
readyLog
option to display a message on client ready (#107)readyLog
option to display a message on client ready (#107)Symbol('default')
(#107)quitClients
(#107)Symbol('default')
(#107)quitClients
(#107)Published by liaoliaots about 3 years ago
@nestjs/terminus@next
- please use v8DEFAULT_REDIS_CLIENT
to DEFAULT_REDIS_NAMESPACE
(#66)ClientOptions
to RedisClientOptions
(#98)defaultOptions
to commonOptions
(#98)DEFAULT_CLUSTER_CLIENT
to DEFAULT_CLUSTER_NAMESPACE
(#66)ClientOptions
to ClusterClientOptions
(#98)@nestjs/terminus
check
to checkHealth
For now, you need to import RedisHealthModule
and RedisHealthIndicator
via:
import { RedisHealthModule, RedisHealthIndicator } from '@liaoliaots/nestjs-redis/health';
RedisHealthModule
to imports
list of @Module()
decoratorRedisHealthIndicator
provider into our service, controller, etcgetRedisToken
to get internal DI token (#95)getClusterToken
to get internal DI token (#95)Published by liaoliaots over 3 years ago
quit
promise safequit
for status ready, otherwise use disconnect
(#56)Published by liaoliaots over 3 years ago