From 5b1e3869341d77ab409d0be45fbf34a6d0af8c43 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sat, 23 Sep 2023 10:22:11 +1000 Subject: [PATCH] Fix stats queue --- healthcheck/worker.js | 2 +- redis.js | 2 +- stats/main.js | 4 ++-- stats/worker.js | 5 +---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/healthcheck/worker.js b/healthcheck/worker.js index 5c0bb9c..b196641 100644 --- a/healthcheck/worker.js +++ b/healthcheck/worker.js @@ -78,7 +78,7 @@ async function doCheck(domainKey, hkey, record) { console.info('fetch()ed health:', domainKey, hkey, record.ip, recordHealth); } else { recordHealth = recordHealth.toString(); - console.log('cached health:', domainKey, hkey, record.ip, recordHealth); + // console.log('cached health:', domainKey, hkey, record.ip, recordHealth); } if (recordHealth === '1') { record.u = true; diff --git a/redis.js b/redis.js index e050582..c2007a3 100644 --- a/redis.js +++ b/redis.js @@ -1,7 +1,7 @@ 'use strict'; import dotenv from 'dotenv'; -await dotenv.config({ path: '.env' }); +dotenv.config({ path: '.env' }); import Redis from 'ioredis';; diff --git a/stats/main.js b/stats/main.js index 1f201ef..4ff415a 100644 --- a/stats/main.js +++ b/stats/main.js @@ -5,11 +5,11 @@ process .on('unhandledRejection', console.error); import dotenv from 'dotenv'; -await dotenv.config({ path: '.env' }); +dotenv.config({ path: '.env' }); import Queue from 'bull'; -const haproxyStatsQueue = new Queue('stats', { w: { +const haproxyStatsQueue = new Queue('stats', { redis: { host: process.env.REDIS_HOST || '127.0.0.1', port: process.env.REDIS_PORT || 6379, password: process.env.REDIS_PASS || '', diff --git a/stats/worker.js b/stats/worker.js index e749b39..a75f57e 100644 --- a/stats/worker.js +++ b/stats/worker.js @@ -5,9 +5,8 @@ process .on('unhandledRejection', console.error); import dotenv from 'dotenv'; -await dotenv.config({ path: '.env' }); +dotenv.config({ path: '.env' }); -import * as redlock from '../redlock.js'; import Queue from 'bull'; const haproxyStatsQueue = new Queue('stats', { redis: { host: process.env.REDIS_HOST || '127.0.0.1', @@ -97,7 +96,6 @@ async function getFormattedStats(host) { }; async function processHost(host) { - console.log(host) try { const hostname = new URL(host).hostname; const { frontendStats, serverStats } = await getFormattedStats(host); @@ -142,7 +140,6 @@ async function processHost(host) { }; async function handleJob(job, done) { - console.log('handleJob') const { hosts } = job.data; hosts.forEach(processHost); done();