UNPKG

@qontrol/express

Version:

Express.js middleware for BullMQ monitoring

24 lines 828 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HealthController = void 0; class HealthController { constructor(qontrol) { this.qontrol = qontrol; } async heathCheck(req, res) { const redis = await this.qontrol.getHealth(); const response = { status: redis.status, redis: { connected: redis.details.redis === 'connected', latency: redis.details.latency, }, timestamp: new Date(), version: process.env.npm_package_version || '1.0.0', }; const statusCode = redis.status === 'healthy' ? 200 : 503; return res.status(statusCode).json(response); } } exports.HealthController = HealthController; //# sourceMappingURL=health.controller.js.map