mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

Infinite loop with the command #211

Open keita-makino opened 3 years ago

keita-makino commented 3 years ago

I have set up the following scripts but the pscale script seems to be called infinitely, while the first attempt successfully initializes the connection to the database. Is it intended behavior and I miss some settings/parameters to include?

"scripts": {
  "start": "npm-run-all -p start pscale",
  "program": "ts-node --transpile-only api/app.ts",
  "pscale": "pscale connect publication next",
},

Successful run by individual call

C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server>npm run pscale

> server@0.0.0 pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next

Secure connection to database publication and branch next is established!.

Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Terminate batch job (Y/N)? 
^C

Unsuccessful run by calling them all

C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server>npm start      

> server@0.1.0 start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale

> server@0.1.0 pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next

> server@0.1.0 start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale

> server@0.1.0 pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next

> server@0.1.0 start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale

> server@0.1.0 start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale

> server@0.1.0 pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next

> server@0.1.0 start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale

> server@0.1.0 pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next

Secure connection to database publication and branch next is established!.

Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Tried address 127.0.0.1:3306, but it's already in use. Picking up a random port ...

> server@0.1.0 pscale C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> pscale connect publication next

> server@0.1.0 start C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server
> npm-run-all -p start pscale

Error: Get "https://api.planetscale.com/v1/organizations/kemakino/databases/publication/branches/next": context canceled
Error: Get "https://api.planetscale.com/v1/organizations/kemakino/databases/publication/branches/next": context canceled
Terminate batch job (Y/N)? 
^C
C:\Users\apricot\src\kemakino\3RFM-ITS-Davis\publication-manager\server>Secure connection to database publication and branch next is established!.

Local address to connect your application: 127.0.0.1:3306 (press ctrl-c to quit)
Secure connection to database publication and branch next is established!.

Local address to connect your application: 127.0.0.1:51199 (press ctrl-c to quit)
okorz001 commented 3 years ago

you are unintentionally fork bombing yourself with this: "start": "npm-run-all -p start pscale",

the start script is running the start script, which then runs the start script, which then runs the start script ...

i assume you meant to put something else there instead of start, maybe program?