@iobroker/db-objects-redis 7.1.2 → 7.2.0-alpha.0-20260612-c8582fd1b
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/build/cjs/lib/objects/objectsInRedisClient.js +10 -1
- package/build/cjs/lib/objects/objectsInRedisClient.js.map +2 -2
- package/build/esm/lib/objects/objectsInRedisClient.d.ts.map +1 -1
- package/build/esm/lib/objects/objectsInRedisClient.js +14 -1
- package/build/esm/lib/objects/objectsInRedisClient.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -139,6 +139,8 @@ class ObjectsInRedisClient {
|
|
|
139
139
|
let connected = false;
|
|
140
140
|
let reconnectCounter = 0;
|
|
141
141
|
let errorLogged = false;
|
|
142
|
+
const isSentinel = Array.isArray(this.settings.connection.host);
|
|
143
|
+
let wasReady = false;
|
|
142
144
|
this.settings.connection.options.retryStrategy = (reconnectCount) => {
|
|
143
145
|
if (!ready && initError) {
|
|
144
146
|
return new Error("No more tries");
|
|
@@ -202,6 +204,9 @@ class ObjectsInRedisClient {
|
|
|
202
204
|
this.log.silly(`${this.namespace} Objects-Redis Event end (stop=${this.stop})`);
|
|
203
205
|
}
|
|
204
206
|
if (ready && typeof this.settings.disconnected === "function") {
|
|
207
|
+
if (!this.stop) {
|
|
208
|
+
this.log.warn(`\u274C ${this.namespace} Objects database disconnected`);
|
|
209
|
+
}
|
|
205
210
|
this.settings.disconnected();
|
|
206
211
|
}
|
|
207
212
|
});
|
|
@@ -211,7 +216,7 @@ class ObjectsInRedisClient {
|
|
|
211
216
|
}
|
|
212
217
|
connected = true;
|
|
213
218
|
if (errorLogged) {
|
|
214
|
-
this.log.info(
|
|
219
|
+
this.log.info(`\u2705 ${this.namespace} Objects database successfully reconnected`);
|
|
215
220
|
errorLogged = false;
|
|
216
221
|
}
|
|
217
222
|
});
|
|
@@ -239,6 +244,10 @@ class ObjectsInRedisClient {
|
|
|
239
244
|
return;
|
|
240
245
|
}
|
|
241
246
|
initError = false;
|
|
247
|
+
if (isSentinel && wasReady) {
|
|
248
|
+
this.log.info(`\u2705 ${this.namespace} Objects DB reconnected via Redis Sentinel (master group "${this.settings.connection.options.name}")`);
|
|
249
|
+
}
|
|
250
|
+
wasReady = true;
|
|
242
251
|
this.log.debug(`${this.namespace} Objects client ready ... initialize now`);
|
|
243
252
|
try {
|
|
244
253
|
await this.client.config("SET", "lua-time-limit", 1e4);
|