@hastehaul/common 2.0.45 → 2.0.46
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.
@@ -38,6 +38,12 @@ class RedisClient {
|
|
38
38
|
constructor(masterHost, replicaHosts) {
|
39
39
|
this.master = new ioredis_1.default({ host: masterHost, port: 6379 });
|
40
40
|
this.replicas = replicaHosts.map(replicaHost => new ioredis_1.default({ host: replicaHost, port: 6379 }));
|
41
|
+
this.master.on("connect", () => console.info("Redis Server Connected!"));
|
42
|
+
this.master.on("error", (error) => console.error("Error in Redis", error.message));
|
43
|
+
this.replicas.forEach((client) => {
|
44
|
+
client.on('connect', () => console.log('Replica connected'));
|
45
|
+
client.on('error', (error) => console.log('Replica connected', error.message));
|
46
|
+
});
|
41
47
|
}
|
42
48
|
// get client(): IORedis {
|
43
49
|
// if(!this._redisClient) throw new Error("Cannot access Redis Client before connecting")
|