Skip to content

Commit

Permalink
pm2@4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Oct 14, 2019
1 parent e24fc12 commit ebef87c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

## 4.0.1

- chore: switch Systeminfo logging to debug

## 4.0.0

- feat: make pm2 fully standalone with node embedded
Expand Down
31 changes: 16 additions & 15 deletions lib/Sysinfo/SystemInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fork = require('child_process').fork
const DEFAULT_CONVERSION = 1024 * 1024
const os = require('os')
const fs = require('fs')
const debug = require('debug')('pm2:sysinfos')

class SystemInfo {
constructor() {
Expand Down Expand Up @@ -102,10 +103,10 @@ class SystemInfo {
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
})

this.process.on('exit', () => {
console.log('systeminfos collection process offline')
this.process.on('exit', (code) => {
console.log(`systeminfos collection process offline with code ${code}`)
if (this.restart == true)
this.fork()
this.fork()
})

this.process.on('error', (e) => {
Expand Down Expand Up @@ -229,7 +230,7 @@ class SystemInfo {
.then(getOsInfo)
.then(diskLayout)
.catch(e => {
console.error(`Error when trying to retrieve static informations`, e)
debug(`Error when trying to retrieve static informations`, e)
})
}

Expand Down Expand Up @@ -257,12 +258,12 @@ class SystemInfo {
next()
})
.catch(e => {
console.error(e)
debug(e)
next()
})
}, (err) => {
if (err)
console.error(err)
debug(err)
this.infos.containers = new_containers.sort((a, b) => {
var textA = a.name.toUpperCase();
var textB = b.name.toUpperCase();
Expand All @@ -272,7 +273,7 @@ class SystemInfo {
})
})
.catch(e => {
console.error(e)
debug(e)
return cb()
})
}
Expand All @@ -284,7 +285,7 @@ class SystemInfo {
this.infos.services.stopped = services.filter(service => service.running === false)
})
.catch(e => {
console.error(e)
debug(e)
})
}

Expand All @@ -300,7 +301,7 @@ class SystemInfo {
return cb()
})
.catch(e => {
console.error(`Error when retrieving process list`, e)
debug(`Error when retrieving process list`, e)
return cb()
})
}
Expand Down Expand Up @@ -366,7 +367,7 @@ class SystemInfo {
return cb()
})
.catch(e => {
console.error(`Error while getting memory info`, e)
debug(`Error while getting memory info`, e)
return cb()
})
}
Expand All @@ -383,7 +384,7 @@ class SystemInfo {
setTimeout(retrieveConn.bind(this), 10 * 1000)
})
.catch(e => {
console.error(`Error while retrieving filesystem infos`, e)
debug(`Error while retrieving filesystem infos`, e)
setTimeout(retrieveConn.bind(this), 10 * 1000)
})
})();
Expand All @@ -403,7 +404,7 @@ class SystemInfo {
setTimeout(fsSizeCollection.bind(this), 30 * 1000)
})
.catch(e => {
console.error(`Error while retrieving filesystem infos`, e)
debug(`Error while retrieving filesystem infos`, e)
setTimeout(fsSizeCollection.bind(this), 10 * 1000)
})
})();
Expand All @@ -428,7 +429,7 @@ class SystemInfo {
setTimeout(ioCollection.bind(this), 1000)
})
.catch(e => {
console.error(`Error while getting network statistics`, e)
debug(`Error while getting network statistics`, e)
setTimeout(ioCollection.bind(this), 1000)
})
})();
Expand Down Expand Up @@ -464,7 +465,7 @@ class SystemInfo {
setTimeout(latencyCollection.bind(this), 2000)
})
.catch(e => {
console.error(e)
debug(e)
setTimeout(latencyCollection.bind(this), 2000)
})
})()
Expand Down Expand Up @@ -508,7 +509,7 @@ class SystemInfo {
setTimeout(networkStatsCollection.bind(this), 1000)
})
.catch(e => {
console.error(`Error on retrieving network stats`, e)
debug(`Error on retrieving network stats`, e)
setTimeout(networkStatsCollection.bind(this), 900)
})
})()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pm2",
"preferGlobal": true,
"version": "4.0.0",
"version": "4.0.1",
"engines": {
"embed": "12.4.0",
"node": ">=8.0.0"
Expand Down

0 comments on commit ebef87c

Please sign in to comment.