diff --git a/svc/monitor.js b/svc/monitor.js index 4befa4d45..884e3f6a9 100644 --- a/svc/monitor.js +++ b/svc/monitor.js @@ -133,17 +133,17 @@ function cassandraUsage(cb) { ); } -function redisUsage(cb) { - redis.info((err) => { - if (err) { - return cb(err); - } - // console.log(info); - return cb(err, { - metric: Number(redis.server_info.used_memory), +async function redisUsage(cb) { + try { + const info = await redis.info(); + const line = info.split('\n').find(line => line.startsWith('used_memory')); + return cb(null, { + metric: Number(line.split(':')[1]), threshold: 4 * 10 ** 9, }); - }); +} catch(e) { + cb(e); +} } const health = { steamApi, diff --git a/svc/syncSubs.js b/svc/syncSubs.js index 096f81ee3..ce7b02ce1 100644 --- a/svc/syncSubs.js +++ b/svc/syncSubs.js @@ -7,7 +7,7 @@ const config = require('../config'); const stripeLib = require('stripe'); const stripe = stripeLib(config.STRIPE_SECRET); -s; + const { invokeInterval } = utility; async function run(cb) {