diff --git a/lib/God/ActionMethods.js b/lib/God/ActionMethods.js index c9272f645..09a0c7faf 100644 --- a/lib/God/ActionMethods.js +++ b/lib/God/ActionMethods.js @@ -801,6 +801,16 @@ module.exports = function(God) { var proc_env = God.clusters_db[id].pm2_env; + 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 (isActionAvailable === false) { + arr.shift(); + return ex(arr); + } + + if ((p.basename(proc_env.pm_exec_path) == name || proc_env.name == name) && (proc_env.status == cst.ONLINE_STATUS ||