0.1.0 • Published 8 years ago

pm2-process-health-check v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

��# pm2-health-check

This module checks the health of the pm2 processes and turns them over if they do don't respond to the health check.

Include the following code in your app to report health to the PM2 module:

process.on('healthcheck', function (packet) {

    // Check the health of your app and infrastructure
    var health = !(Math.random()+.5|0);

    // Send back the status
    process.send({
        type : 'process:msg:healthcheck',
        data : {
            health_check_id: packet.data.health_check_id,
            health: health
        }
    });
});