Skip to content

Commit

Permalink
Merge pull request #5857 from aryehb/feature/disable-version-check
Browse files Browse the repository at this point in the history
Add support for disabling version checks
  • Loading branch information
Unitech authored Nov 13, 2024
2 parents be15de4 + 3402a0d commit de0dec5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Client.prototype.initFileStructure = function (opts) {
}
}

if (!process.env.PM2_PROGRAMMATIC && !fs.existsSync(path.join(opts.PM2_HOME, 'touch'))) {
if (!process.env.PM2_DISABLE_VERSION_CHECK && !process.env.PM2_PROGRAMMATIC && !fs.existsSync(path.join(opts.PM2_HOME, 'touch'))) {

var vCheck = require('./VersionCheck.js')

Expand Down
14 changes: 8 additions & 6 deletions lib/Worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,14 @@ module.exports = function(God) {
God.Worker.start = function() {
timer = setInterval(wrappedTasks, cst.WORKER_INTERVAL);

setInterval(() => {
vCheck({
state: 'check',
version: pkg.version
})
}, 1000 * 60 * 60 * 24)
if (!process.env.PM2_DISABLE_VERSION_CHECK) {
setInterval(() => {
vCheck({
state: 'check',
version: pkg.version,
});
}, 1000 * 60 * 60 * 24);
}
};

God.Worker.stop = function() {
Expand Down

0 comments on commit de0dec5

Please sign in to comment.