From 491932b1b7b09cd1bf6d26252dcdd818e01d710c Mon Sep 17 00:00:00 2001 From: roylines Date: Sat, 14 Nov 2015 09:50:38 +0000 Subject: [PATCH] fixed link and reworded --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 479092e..59be41f 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,17 @@ [![Circle CI](https://circleci.com/gh/roylines/hapi-graceful-pm2.svg?style=svg)](https://circleci.com/gh/roylines/hapi-graceful-pm2) [![Coverage Status](https://coveralls.io/repos/roylines/hapi-graceful-pm2/badge.svg?branch=master&service=github)](https://coveralls.io/github/roylines/hapi-graceful-pm2?branch=master) -This is a [hapi plugin](http://hapijs.com/tutorials/plugins) to handle true zero downtime reloads when issuing a [pm2 gracefulReload]((https://keymetrics.io/2015/03/26/pm2-clustering-made-easy) command. +This is a [hapi plugin](http://hapijs.com/tutorials/plugins) to handle true zero downtime reloads when issuing +a [pm2 gracefulReload](https://keymetrics.io/2015/03/26/pm2-clustering-made-easy) command. -When using this plugin and calling 'pm2 gracefulReload', the 'shutdown' message will be intercepted and will waits for hapi to drain all connections before exiting the worker. This will ensure any in progress requests are completed before exiting. Whilst waiting, no new requests will be forwarded to the worker. Without this plugin the issueing of a gracefulReload will terminate any in progress requests without waiting. You can pass a timeout to the plugin. This is how long to wait for hapi to drain all connections. Note: the PM2_GRACEFUL_TIMEOUT environment variable should be set to a value higher than the plugin timeout. +When using this plugin and calling 'pm2 gracefulReload', the 'shutdown' message will be intercepted and will +wait for hapi to drain all connections before exiting the worker. +This will ensure any in progress requests are completed before exiting. +Whilst waiting, no new requests will be forwarded to the worker. + +Without this plugin the issuing of a gracefulReload will terminate any in progress requests without waiting. +You can pass a timeout that configures the maximum time hapi should wait to drain all connections. +Note: the PM2_GRACEFUL_TIMEOUT environment variable should be set to a value higher than the plugin timeout to ensure pm2 doesn't timeout before hapi. The pm2 shutdown process is described [here](https://keymetrics.io/2015/03/26/pm2-clustering-made-easy).