添加 Redis是否enabled的配置处理

This commit is contained in:
tone
2024-09-26 13:55:06 +08:00
parent 9bbd87af0e
commit 82bfb826b2
2 changed files with 6 additions and 0 deletions

View File

@@ -7,6 +7,11 @@ class _RedisConnection {
private logger = new Logger('Redis')
constructor() {
if (!config.redis.enable) {
this.logger.info('Database is disabled, initialization terminated');
return;
}
try {
this.pool = new Redis({
port: config.redis.port,