diff --git a/src/server/accounts.js b/src/server/accounts.js index 7e5b93f79..2c862992b 100644 --- a/src/server/accounts.js +++ b/src/server/accounts.js @@ -6,6 +6,9 @@ import clientConfig from "../client-config.json"; import Currency from "../lib/Currency"; const redisClient = redis.createClient(config.redis); +redisClient.on("error", err => { + console.error("Redis unavailable"); +}); const nano = new Nano({ url: config.nodeHost }); async function calculateAccountList() { diff --git a/src/server/helpers/frontiers.js b/src/server/helpers/frontiers.js index 3ba801406..3d4768b9a 100644 --- a/src/server/helpers/frontiers.js +++ b/src/server/helpers/frontiers.js @@ -4,6 +4,9 @@ import redis from "redis"; import config from "../../../server-config.json"; const redisClient = redis.createClient(config.redis); +redisClient.on("error", err => { + console.error("Redis unavailable"); +}); const zcount = promisify(redisClient.zcount.bind(redisClient)); const zrevrange = promisify(redisClient.zrevrange.bind(redisClient)); diff --git a/src/server/helpers/tpsCalculator.js b/src/server/helpers/tpsCalculator.js index 7bde8ac43..1037c9052 100644 --- a/src/server/helpers/tpsCalculator.js +++ b/src/server/helpers/tpsCalculator.js @@ -3,6 +3,9 @@ import redis from "redis"; import config from "../../../server-config.json"; const redisClient = redis.createClient(config.redis); +redisClient.on("error", err => { + console.error("Redis unavailable"); +}); const zRangeByScore = promisify(redisClient.zrangebyscore.bind(redisClient)); const STORAGE_KEY = `nano-control-panel/${config.redisNamespace || diff --git a/src/server/networkTps.js b/src/server/networkTps.js index 37753c0e3..543925ded 100644 --- a/src/server/networkTps.js +++ b/src/server/networkTps.js @@ -4,6 +4,9 @@ import redis from "redis"; import config from "../../server-config.json"; const redisClient = redis.createClient(config.redis); +redisClient.on("error", err => { + console.error("Redis unavailable"); +}); const nano = new Nano({ url: config.nodeHost }); const STORAGE_PERIOD = 60 * 60 * 24 * 7 * 1000; // 1 week