Skip to content

Commit

Permalink
fix for inspect option
Browse files Browse the repository at this point in the history
  • Loading branch information
asyed94 committed Dec 28, 2023
1 parent 98d2c17 commit aade403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module.exports = async function (networkDir, num, type, pm2Args, options) {
for (let i = 0; i < nodesToStart; i++) {
if (!networkConfig.runningPorts.includes(networkConfig.lowestPort + i)) {
if (instances[i]) {
if (options.inspect) {
if (options?.inspect) {
await util.pm2Start(networkDir, networkConfig.serverPath, path.basename(instances[i]), { BASE_DIR: instances[i] }, [`pm2--node-args="--inspect=127.0.0.1:${networkConfig.inspectPort + i}"`, ...pm2Args])
} else {
await util.pm2Start(networkDir, networkConfig.serverPath, path.basename(instances[i]), { BASE_DIR: instances[i] }, pm2Args)
Expand All @@ -136,7 +136,7 @@ module.exports = async function (networkDir, num, type, pm2Args, options) {

if (type === 'start') {
for (let i = instances.length - num; i < instances.length; i++) {
if (options.inspect) {
if (options?.inspect) {
await util.pm2Start(networkDir, networkConfig.serverPath, path.basename(instances[i]), { BASE_DIR: instances[i] }, [`pm2--node-args="--inspect=127.0.0.1:${networkConfig.inspectPort + i}"`, ...pm2Args])
} else {
await util.pm2Start(networkDir, networkConfig.serverPath, path.basename(instances[i]), { BASE_DIR: instances[i] }, pm2Args)
Expand Down

0 comments on commit aade403

Please sign in to comment.