pidusage icon indicating copy to clipboard operation
pidusage copied to clipboard

Allow PIDUSAGE_USE_PS to have string type of "true"

Open basiam opened this issue 4 years ago • 3 comments

Q A
Branch? main
Bug fix? no
New feature? no (well, maybe - I really small one)
Deprecations? no
Tickets no
License MIT
Doc PR

I have been using pm2 on DigitalOcean and wanted to set process.env.PIDUSAGE_USE_PS as per the discussion here https://github.com/Unitech/pm2/issues/5045. But because we are using Node and in Node environment variables are always strings, this comparison below fails for "true" === true or "1" === true etc. https://github.com/soyuka/pidusage/blob/61f63bd9e8f576c4b7b673171dc7262bd3c26ae8/lib/stats.js#L50

The code below makes it work for "true".

basiam avatar Dec 09 '21 10:12 basiam

Who can we tag for visibility here? A lot of people would benefit from this PR! See https://github.com/Unitech/pm2/issues/4360

ansonkao avatar Apr 01 '22 14:04 ansonkao

Any chance this could make it in? using digital ocean "app container" and wasn't able to fix the PM2 error: Error caught while calling pidusage error. had to switch to something else.

Apezdr avatar Apr 28 '22 22:04 Apezdr

I had to do a patch-package in pm2 via https://github.com/Unitech/pm2/issues/4360#issuecomment-1148869202 in order to make this work in digitalocean apps.

This PR would be massive.

leerobert avatar Aug 17 '22 15:08 leerobert

am so sorry I didn't merge early, will get into the next patch!

soyuka avatar Oct 25 '22 13:10 soyuka