fix Command on Event timeout
parent
5908830f39
commit
085b6df7d9
|
@ -233,7 +233,7 @@ module.exports = function(s,config){
|
|||
break;
|
||||
}
|
||||
}
|
||||
s.createTimeout = function(timeoutVar,timeoutLength,defaultLength,multiplier,callback){
|
||||
s.createTimeout = function(timeoutVar,parentVar,timeoutLength,defaultLength,multiplier,callback){
|
||||
var theTimeout
|
||||
if(!multiplier)multiplier = 1000 * 60
|
||||
if(!timeoutLength || timeoutLength === ''){
|
||||
|
@ -241,13 +241,13 @@ module.exports = function(s,config){
|
|||
}else{
|
||||
theTimeout = parseFloat(timeoutLength) * multiplier
|
||||
}
|
||||
clearTimeout(timeoutVar)
|
||||
timeoutVar = setTimeout(function(){
|
||||
clearTimeout(timeoutVar)
|
||||
delete(timeoutVar)
|
||||
clearTimeout(parentVar[timeoutVar])
|
||||
parentVar[timeoutVar] = setTimeout(function(){
|
||||
clearTimeout(parentVar[timeoutVar])
|
||||
delete(parentVar[timeoutVar])
|
||||
if(callback)callback()
|
||||
},theTimeout)
|
||||
return timeoutVar
|
||||
return parentVar[timeoutVar]
|
||||
}
|
||||
s.isCorrectFilenameSyntax = function(string){
|
||||
return RegExp('[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]-[0-9][0-9]-[0-9][0-9]').test(string)
|
||||
|
|
|
@ -325,7 +325,7 @@ module.exports = function(s,config,lang){
|
|||
}
|
||||
|
||||
if(filter.command && currentConfig.detector_command_enable === '1' && !s.group[d.ke].activeMonitors[d.id].detector_command){
|
||||
s.group[d.ke].activeMonitors[d.id].detector_command = s.createTimeout(s.group[d.ke].activeMonitors[d.id].detector_command,currentConfig.detector_command_timeout,10)
|
||||
s.group[d.ke].activeMonitors[d.id].detector_command = s.createTimeout('detector_command',s.group[d.ke].activeMonitors[d.id],currentConfig.detector_command_timeout,10)
|
||||
var detector_command = addEventDetailsToString(d,currentConfig.detector_command)
|
||||
if(detector_command === '')return
|
||||
exec(detector_command,{detached: true},function(err){
|
||||
|
|
Loading…
Reference in New Issue