pm2-perfmonitor 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/utils.js +6 -3
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -45,9 +45,12 @@ const sleepAsync = (duration = 0) => {
45
45
  * @returns { Promise<number> } CPU 使用率
46
46
  */
47
47
  const getSysCpuUsageByPid = async (pid) => {
48
- const stats = await pidusage(pid)
49
-
50
- return stats.cpu
48
+ try {
49
+ const stats = await pidusage(pid)
50
+ return stats.cpu
51
+ } catch (err) {
52
+ console.error('Call pidusage error:', err)
53
+ }
51
54
  }
52
55
 
53
56
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pm2-perfmonitor",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "A pm2 module for performance monitoring. Automatically detect zombie processes and restart it",
5
5
  "author": {
6
6
  "name": "elenh",