Skip to content

Commit

Permalink
[zmarkdown] Fix getting processus status in Munin controller (#501)
Browse files Browse the repository at this point in the history
Since status `online` is coded as `0`, `0` was evaluated as `false` and
thus the fallback value `3` was taken. Now, we use a ternary operator to
test if the status is in the dictionnary to map to a number.
  • Loading branch information
philippemilink authored Dec 10, 2023
1 parent e600131 commit 7bd69e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/zmarkdown/server/controllers/munin.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = isConfig => (req, res) => {
}

const data = {
status: status[proc.pm2_env.status] || 3,
status: proc.pm2_env.status in status ? status[proc.pm2_env.status] : 3,
memory: proc.monit.memory,
cpu: proc.monit.cpu,
event_loop_lag: loopLag || 'U',
Expand Down

0 comments on commit 7bd69e6

Please sign in to comment.