Redis module for Nest framework (node.js). Support node-redis & ioredis.
MIT License
Bot releases are hidden (Show)
Published by liaoliaots 27 days ago
"module": "Node16"
, "moduleResolution": "Node16"
exports
type
field in package.json for modern Node.jsPublished by liaoliaots 27 days ago
node-redis^4.1.0
, ioredis^5.0.0
.InjectRedis
and InjectCluster
won't handle dependencies correctly(for example: a module import RedisModule and re-export it will cause "Cannot resolve dependency" error) thus leading to errors and there is no better solution so InjectRedis
and InjectCluster
will be removed and please use RedisManager
&ClusterManager
instead which is the most stable solution.Published by liaoliaots almost 2 years ago
Published by liaoliaots almost 2 years ago
Published by liaoliaots almost 2 years ago
Published by liaoliaots about 2 years ago
[email protected] LTS
[email protected]
jest-extended
directly instead of global.d.ts file (#366)@liaoliaots/nestjs-redis
to 9.0.3 (#366)@liaoliaots/nestjs-redis-health
to 9.0.2 (#366)Published by liaoliaots about 2 years ago
Published by liaoliaots over 2 years ago
onApplicationShutdown
hook is invoked (#320)tsc-alias
to v1.7.0 (#320)Published by liaoliaots over 2 years ago
If you depend on NestJS 7 or 8, please use version 8 of the lib.
There are two packages in this repo now:
@liaoliaots/nestjs-redis
@liaoliaots/nestjs-redis-health
NestJS@8
and NestJS@7
, minimum supported NestJS version is NestJS@9
RedisHealthModule
was removed from @liaoliaots/nestjs-redis
, now you should install @liaoliaots/nestjs-redis-health
to use itPublished by liaoliaots over 2 years ago
type
argument is invalid, now the indicator will throw an error (#286)onClientCreated
option as it can be used to specify custom loggers (#286)x
to ^
(#286)tsc-alias
to v1.6.11 (#286)Published by liaoliaots over 2 years ago
tsc-alias
to v1.6.9 (#283)Published by liaoliaots over 2 years ago
redis
path
option to support unix domain socket (#256)Published by liaoliaots over 2 years ago
tsc-alias
to v1.6.7 (#240)tslib
to v2.4.0 (#240)[email protected] LTS
Published by liaoliaots over 2 years ago
errorLog
option to display error logging while connecting. (Default: true
) (#236)Published by liaoliaots over 2 years ago
If you depend on ioredis@4
, please use version7 of the plugin.
ioredis@5
, which includes some breaking changes, please read (#223)Node.js@10
, minimum supported Node.js
version is [email protected]
(#223)promise.allsettled
, @types/promise.allsettled
(#223)@types/ioredis
(#223)Node.js@16 LTS
(#219)Published by liaoliaots over 2 years ago
on
to listen ready event instead of once
(#208)timeout
option to check if ping times out, set the default value to 1000 (#199) (#200)memoryThreshold
option to check maximum amount of memory (#199) (#200)MissingConfigurationError
, ClientNotFoundError
(#201)RedisService
, ClusterService
, InjectRedis
, InjectCluster
(#209)InjectRedis
, InjectCluster
(#210)InjectRedis
, InjectCluster
(#210)RedisCheckOptions
to RedisCheckSettings
and refactor it (#199) (#200)checkHealth
(#199) (#200) (#206)v7:
@Controller('app')
export class AppController {
constructor(
private readonly health: HealthCheckService,
private readonly redisIndicator: RedisHealthIndicator,
@InjectRedis() private readonly redis: Redis,
@InjectCluster() private readonly cluster: Cluster
) {}
@Get('health')
@HealthCheck()
async healthChecks(): Promise<HealthCheckResult> {
return await this.health.check([
() => this.redisIndicator.checkHealth('redis', { type: 'redis', client: this.redis }),
() => this.redisIndicator.checkHealth('cluster', { type: 'cluster', client: this.cluster })
]);
}
}
old:
@Controller('app')
export class AppController {
constructor(
private readonly health: HealthCheckService,
private readonly redisIndicator: RedisHealthIndicator,
@InjectRedis() private readonly redis: Redis,
@InjectCluster() private readonly cluster: Cluster
) {}
@Get('health')
@HealthCheck()
async healthChecks(): Promise<HealthCheckResult> {
return await this.health.check([
() => this.redisIndicator.checkHealth('redis', { client: this.redis }),
() => this.redisIndicator.checkHealth('cluster', { client: this.cluster })
]);
}
}
options
for ClusterClientOptions
(#202)v7:
ClusterModule.forRoot({
readyLog: true,
config: {
nodes: [{ host: '127.0.0.1', port: 16380 }],
enableOfflineQueue: true,
enableReadyCheck: true,
scaleReads: 'all',
redisOptions: { password: 'cluster1' }
}
})
old:
ClusterModule.forRoot({
readyLog: true,
config: {
nodes: [{ host: '127.0.0.1', port: 16380 }],
options: {
enableOfflineQueue: true,
enableReadyCheck: true,
scaleReads: 'all',
redisOptions: { password: 'cluster1' }
}
}
})
Published by liaoliaots over 2 years ago
Published by liaoliaots over 2 years ago
Published by liaoliaots over 2 years ago
options
in ClusterClientOptions
v7:
ClusterModule.forRoot({
readyLog: true,
config: {
nodes: [{ host: '127.0.0.1', port: 16380 }],
enableOfflineQueue: true,
enableReadyCheck: true,
scaleReads: 'all',
redisOptions: { password: 'cluster1' }
}
})
v6:
ClusterModule.forRoot({
readyLog: true,
config: {
nodes: [{ host: '127.0.0.1', port: 16380 }],
options: {
enableOfflineQueue: true,
enableReadyCheck: true,
scaleReads: 'all',
redisOptions: { password: 'cluster1' }
}
}
})