|
@@ -76,13 +76,16 @@ class _CacheModule extends CoreClass {
|
|
this.log("ERROR", `Error ${err.message}.`);
|
|
this.log("ERROR", `Error ${err.message}.`);
|
|
});
|
|
});
|
|
|
|
|
|
- this.client.connect().then(async () => {
|
|
|
|
- this.log("INFO", "Connected succesfully.");
|
|
|
|
-
|
|
|
|
|
|
+ this.client.on("ready", () => {
|
|
|
|
+ this.log("INFO", "Redis is ready.");
|
|
if (this.getStatus() === "INITIALIZING") resolve();
|
|
if (this.getStatus() === "INITIALIZING") resolve();
|
|
else if (this.getStatus() === "FAILED" || this.getStatus() === "RECONNECTING") this.setStatus("READY");
|
|
else if (this.getStatus() === "FAILED" || this.getStatus() === "RECONNECTING") this.setStatus("READY");
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ this.client.connect().then(async () => {
|
|
|
|
+ this.log("INFO", "Connected succesfully.");
|
|
|
|
+ });
|
|
|
|
+
|
|
// TODO move to a better place
|
|
// TODO move to a better place
|
|
CacheModule.runJob("KEYS", { pattern: "longJobs.*" }).then(keys => {
|
|
CacheModule.runJob("KEYS", { pattern: "longJobs.*" }).then(keys => {
|
|
async.eachLimit(keys, 1, (key, next) => {
|
|
async.eachLimit(keys, 1, (key, next) => {
|