Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When monitoring a script, it's handy to limit the maximum number of restart. But it's not the same if the script fails 10 times in 10 seconds and 10 times in 10 weeks. On the first case, there is probably an hard error and it's better to stop soon trying to restart this script. But on the second case, a max of 10 is not enough. Maybe it's just a crontab running once a week that makes it fail.
The cooldownInterval is here to make max time sensitive. Forever-monitor keeps a counter with the number of failures of the script. When this counter reaches the max, it stops trying to restart it. With
cooldownInterval, this counter is halfed at a regular interval defined by the number of seconds of cooldownInterval.
For example, with cooldownInterval=300, if the counter is at 4 failures and in the next 5 minutes, the script won't fail, it will go to 2. And if the next 5 following minutes, it still run quiet, it will go to 1. And 5 more minutes, and will be reset to 0.