wlingke
wlingke

Reputation: 4799

Multiple jobs on one Heroku dyno in NodeJS

I've got four processes defined in my Procfile:

web: node app.js job1: node job1.js job2: node job2.js job3: node job3.js

When I run deploy this heroku, it spins up four dynos. The jobs are light enough that they can all be run on one dyno. However, I don't want to combine all the jobs into one file.

Is there a setting or something that I can use to get job1,job2,job3 to all run on one dyno?

Upvotes: 2

Views: 1207

Answers (1)

vodolaz095
vodolaz095

Reputation: 6986

Try to run this all parallel (like they say in Running several scripts in parallel bash script)

//Procfile
web: node app.js & node job1.js & node job2.js & node job3.js

But it can clutter the logs...

Upvotes: 2

Related Questions