26 lines
701 B
JavaScript
26 lines
701 B
JavaScript
require('dotenv').config();
|
|
const Redis = require('ioredis');
|
|
const { Queue } = require('bullmq');
|
|
|
|
async function main(){
|
|
const health = { ok: true, redisUrlPresent: !!process.env.REDIS_URL, timestamp: new Date().toISOString() };
|
|
console.log('health', health);
|
|
|
|
if (!process.env.REDIS_URL) {
|
|
console.error('No REDIS_URL set in environment');
|
|
process.exit(1);
|
|
}
|
|
|
|
const conn = new Redis(process.env.REDIS_URL);
|
|
const q = new Queue('intune-sync-queue', { connection: conn });
|
|
const counts = await q.getJobCounts();
|
|
console.log('queue', counts);
|
|
await q.close();
|
|
await conn.quit();
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error('health-check-error', err);
|
|
process.exit(1);
|
|
});
|