pm2-process-health-check

A PM2 module to check and restart frozen processes

Usage no npm install needed!

<script type="module">
  import pm2ProcessHealthCheck from 'https://cdn.skypack.dev/pm2-process-health-check';
</script>

README

��#� �p�m�2�-�h�e�a�l�t�h�-�c�h�e�c�k� � � � �T�h�i�s� �m�o�d�u�l�e� �c�h�e�c�k�s� �t�h�e� �h�e�a�l�t�h� �o�f� �t�h�e� �p�m�2� �p�r�o�c�e�s�s�e�s� �a�n�d� �t�u�r�n�s� �t�h�e�m� �o�v�e�r� �i�f� �t�h�e�y� �d�o� �d�o�n�'�t� �r�e�s�p�o�n�d� �t�o� �t�h�e� �h�e�a�l�t�h� �c�h�e�c�k�.� � � � �I�n�c�l�u�d�e� �t�h�e� �f�o�l�l�o�w�i�n�g� �c�o�d�e� �i�n� �y�o�u�r� �a�p�p� �t�o� �r�e�p�o�r�t� �h�e�a�l�t�h� �t�o� �t�h�e� �P�M�2� �m�o�d�u�l�e�:� � � � �javascript 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 } }); }); � � �