@ikonintegration/ikapi 2.6.6 → 2.6.7
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
CHANGED
|
@@ -123,12 +123,14 @@ export default class IKCache_Redis extends IKCache {
|
|
|
123
123
|
//redis v4 & v3 compatibility
|
|
124
124
|
if (connection && connection.connect) await connection.connect();
|
|
125
125
|
//
|
|
126
|
-
|
|
126
|
+
connectedHandler = () => {
|
|
127
127
|
this.connection = connection;
|
|
128
128
|
if (this.awaitingConnectionQueue) this.awaitingConnectionQueue.forEach((resolve) => resolve());
|
|
129
129
|
this.awaitingConnectionQueue = null;
|
|
130
130
|
resolve();
|
|
131
|
-
}
|
|
131
|
+
}
|
|
132
|
+
connection.on('connect', connectedHandler);
|
|
133
|
+
if (isV4) connectedHandler(); //reached here on v4, everything is connected
|
|
132
134
|
connection.on('error', (err) => {
|
|
133
135
|
localConsole.error(err);
|
|
134
136
|
if (this.awaitingConnectionQueue) this.awaitingConnectionQueue.forEach((resolve) => resolve()); //fulfill, error will be thrown
|