Unitech / Unitech/pm2

'pm2 flush' only supports single app

Open
#5,169 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

I found https://github.com/Unitech/pm2/issues/3270 while looking for a way to log multiple apps and that worked but then I noticed that flush does not support this.

I can get around it with pm2 flush appA && pm2 flush appB but just thought it would be nice to use the RegExp pattern.

How could we reproduce this issue?

Run the following:

pm2 flush "/(appA|appB)/"

Supporting information

$ pm2 report
--- PM2 report ----------------------------------------------------------------
Date                 : Tue Sep 07 2021 14:18:39 GMT-0500 (Central Daylight Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.1.0
node version         : 14.15.0
node path            : /Users/eliw00d/.nvm/versions/node/v14.15.0/bin/yarn
argv                 : /Users/eliw00d/.nvm/versions/node/v14.15.0/bin/node,/Users/eliw00d/Documents/GitHub/project/node_modules/pm2/lib/Daemon.js
argv0                : /Users/eliw00d/.nvm/versions/node/v14.15.0/bin/node
user                 : eliw00d
uid                  : 1220747810
gid                  : 1244359605
uptime               : 32min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.1.0
node version         : 14.15.0
node path            : /Users/eliw00d/.nvm/versions/node/v14.15.0/bin/yarn
argv                 : /Users/eliw00d/.nvm/versions/node/v14.15.0/bin/node,/Users/eliw00d/Documents/GitHub/project/node_modules/pm2/bin/pm2,report
argv0                : /Users/eliw00d/.nvm/versions/node/v14.15.0/bin/node
user                 : eliw00d
uid                  : 1220747810
gid                  : 1244359605
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : darwin
type                 : Darwin
cpus                 : Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
cpus nb              : 16
freemem              : 588169216
totalmem             : 34359738368
home                 : /Users/eliw00d
===============================================================================

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the pm2 flush CLI entry point and reproduce the reported command pm2 flush "/(appA|appB)/" alongside the separate flush commands. Trace how the argument is matched to applications and verify that the regexp form flushes both appA and appB when the work is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.