Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/binaries/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,20 @@ commander.command('profile:cpu [time]')
//
// Reload process(es)
//
commander.command('reload <id|name|namespace|all>')
commander.command('reload <id|name|namespace|all...>')
.description('reload processes (note that its for app using HTTP/HTTPS)')
.action(function(pm2_id) {
pm2.reload(pm2_id, commander);
.action(function(param) {
// Commander.js patch
param = patchCommanderArg(param);
let acc = []
forEachLimit(param, 1, function(script, next) {
pm2.reload(script, commander, (err, apps) => {
acc = acc.concat(apps)
next(err)
});
}, function(err) {
pm2.speedList(err ? 1 : 0, acc);
});
});

commander.command('id <name>')
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/cli/multiparam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ $pm2 restart child echo server
should 'should app be online' 'online' 3
should 'should all script been restarted one time' 'restart_time: 1' 3

## Reload
$pm2 reload child echo server
should 'should all script been restarted two times' 'restart_time: 2' 3

## Stop
$pm2 stop child echo server
should 'should app be stopped' 'stopped' 3
Expand Down