diff --git a/lib/God/ActionMethods.js b/lib/God/ActionMethods.js index 0df19e03a..09a0c7faf 100644 --- a/lib/God/ActionMethods.js +++ b/lib/God/ActionMethods.js @@ -801,17 +801,11 @@ module.exports = function(God) { var proc_env = God.clusters_db[id].pm2_env; - var action_exist = false; - proc_env.axm_actions.forEach(function(action) { - console.log(action, cmd) - if (action.action_name === cmd.msg) { - action_exist = true; - } - }); + const isActionAvailable = proc_env.axm_actions.find(action => action.action_name === cmd.msg) !== undefined // if action doesn't exist for this app // try with the next one - if (action_exist === false) { + if (isActionAvailable === false) { arr.shift(); return ex(arr); }