Skip to content

Commit

Permalink
refactor: #3786 clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Aug 21, 2018
1 parent 1ff7fd3 commit 6cbca8b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/God/ActionMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6cbca8b

Please sign in to comment.