Skip to content

Commit

Permalink
fix: solve empty list when no process and try to update pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Mar 2, 2018
1 parent ced2835 commit 8951184
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/API/Startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,12 @@ module.exports = function(CLI) {
// try to fix issues with empty dump file
// like #3485
if (env_arr.length === 0) {

// fix : if no dump file, no process, only module and after pm2 update
if (!fs.existsSync(cst.DUMP_FILE_PATH)) {
that.clearDump(function(){});
}

// if no process in list don't modify dump file
// process list should not be empty
if(cb) {
Expand Down
6 changes: 6 additions & 0 deletions lib/God/ActionMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ module.exports = function(God) {
// try to fix issues with empty dump file
// like #3485
if (process_list.length === 0) {

// fix : if no dump file, no process, only module and after pm2 update
if (!fs.existsSync(cst.DUMP_FILE_PATH)) {
that.clearDump(function(){});
}

// if no process in list don't modify dump file
// process list should not be empty
return cb(null, {success:true, process_list: process_list});
Expand Down

0 comments on commit 8951184

Please sign in to comment.