diff --git a/lib/API/Startup.js b/lib/API/Startup.js index 3064e6a62..f77ca5167 100644 --- a/lib/API/Startup.js +++ b/lib/API/Startup.js @@ -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) { diff --git a/lib/God/ActionMethods.js b/lib/God/ActionMethods.js index 37a6255cf..1df6b159c 100644 --- a/lib/God/ActionMethods.js +++ b/lib/God/ActionMethods.js @@ -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});