@xnestjs/ioredis 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/redis-core.module.js +7 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xnestjs/ioredis",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"description": "NestJS extension library for ioredis",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jsopen/objects": "^2.0
|
|
8
|
+
"@jsopen/objects": "^2.1.0",
|
|
9
9
|
"ansi-colors": "^4.1.3",
|
|
10
|
-
"putil-varhelpers": "^1.
|
|
10
|
+
"putil-varhelpers": "^1.7.0",
|
|
11
11
|
"tslib": "^2.8.1"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
package/redis-core.module.js
CHANGED
|
@@ -124,6 +124,7 @@ let RedisCoreModule = RedisCoreModule_1 = class RedisCoreModule {
|
|
|
124
124
|
this.client = client;
|
|
125
125
|
this.connectionOptions = connectionOptions;
|
|
126
126
|
this.logger = logger;
|
|
127
|
+
this.logger = logger || new Logger('Redis');
|
|
127
128
|
}
|
|
128
129
|
async onApplicationBootstrap() {
|
|
129
130
|
const opts = this.connectionOptions;
|
|
@@ -142,12 +143,18 @@ let RedisCoreModule = RedisCoreModule_1 = class RedisCoreModule {
|
|
|
142
143
|
if (hosts) {
|
|
143
144
|
this.logger?.log('Connecting to redis at ' + colors.blue(hosts));
|
|
144
145
|
Logger.flush();
|
|
146
|
+
const logTimer = setTimeout(() => {
|
|
147
|
+
this.logger?.verbose('Waiting to connect to redis at ' + colors.blue(hosts));
|
|
148
|
+
}, 1000);
|
|
145
149
|
try {
|
|
146
150
|
if (this.client.redis.status === 'wait')
|
|
147
151
|
await this.client.redis.connect();
|
|
148
152
|
await this.client.redis.ping();
|
|
153
|
+
clearTimeout(logTimer);
|
|
154
|
+
this.logger?.log(`Redis connection established`);
|
|
149
155
|
}
|
|
150
156
|
catch (e) {
|
|
157
|
+
clearTimeout(logTimer);
|
|
151
158
|
this.logger?.error('Redis connection failed: ' + e.message);
|
|
152
159
|
throw e;
|
|
153
160
|
}
|