add Fatal Error Exit notice, clean up fatal_max error check+
parent
70ea243cba
commit
de18962860
|
|
@ -441,9 +441,7 @@ module.exports = function(s,config,lang){
|
|||
"name": "detail=fatal_max",
|
||||
"field": lang['Retry Connection'],
|
||||
"description": lang["fieldTextFatalMax"],
|
||||
"default": "10",
|
||||
"example": "",
|
||||
"possible": "",
|
||||
"example": "10",
|
||||
},
|
||||
{
|
||||
"name": "detail=skip_ping",
|
||||
|
|
|
|||
|
|
@ -898,6 +898,8 @@
|
|||
"Simple": "Simple",
|
||||
"Advanced": "Advanced",
|
||||
"Error Connecting": "Error Connecting",
|
||||
"Fatal Error": "Fatal Error",
|
||||
"onFatalErrorExit": "This monitor has failed too many times with high severity errors. It will now be stopped to prevent performance issues on your system.",
|
||||
"DB Lost.. Retrying..": "Database Lost.. Retrying..",
|
||||
"Retrying...": "Retrying...",
|
||||
"Filter Matches": "Filter Matches",
|
||||
|
|
|
|||
|
|
@ -1348,12 +1348,13 @@ module.exports = function(s,config,lang){
|
|||
function fatalError(e,errorMessage){
|
||||
const activeMonitor = s.group[e.ke].activeMonitors[e.id]
|
||||
const monitorDetails = s.group[e.ke].rawMonitorConfigurations[e.id].details
|
||||
const maxCount = isNaN(monitorDetails.fatal_max) ? 0 : parseFloat(monitorDetails.fatal_max)
|
||||
const maxCount = !monitorDetails.fatal_max || isNaN(monitorDetails.fatal_max) ? 0 : parseFloat(monitorDetails.fatal_max);
|
||||
clearTimeout(activeMonitor.err_fatal_timeout);
|
||||
++activeMonitor.errorFatalCount;
|
||||
if(activeMonitor.isStarted === true){
|
||||
activeMonitor.err_fatal_timeout = setTimeout(function(){
|
||||
if(maxCount !== 0 && activeMonitor.errorFatalCount > maxCount){
|
||||
s.userLog(e,{type:lang["Fatal Error"],msg:lang.onFatalErrorExit});
|
||||
s.camera('stop',{id:e.id,ke:e.ke})
|
||||
}else{
|
||||
launchMonitorProcesses(s.cleanMonitorObject(e))
|
||||
|
|
|
|||
Loading…
Reference in New Issue