Fixed issue where clients without redis struggled with starting the server

This commit is contained in:
Kasper Rynning-Tønnesen
2018-02-25 15:58:02 +01:00
parent df1dc29735
commit 9a877fa18e

View File

@@ -12,8 +12,16 @@ pathThumbnails = __dirname;
try { try {
var redis = require("redis"); var redis = require("redis");
var client = redis.createClient({host: "localhost", port: 6379}); var client = redis.createClient({host: "localhost", port: 6379});
client.quit(); client.on("error", function (err) {
startClustered(true); console.log("Couldn't connect to redis-server, assuming non-clustered run");
num_processes = 1;
startClustered(false);
client.quit();
});
client.on("connect", function() {
startClustered(true);
client.quit();
});
} catch(e) { } catch(e) {
console.log("Couldn't connect to redis-server, assuming non-clustered run"); console.log("Couldn't connect to redis-server, assuming non-clustered run");
num_processes = 1; num_processes = 1;