2

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?

wlingke
  • 4,699
  • 4
  • 36
  • 52

1 Answers1

2

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...

Community
  • 1
  • 1
vodolaz095
  • 6,680
  • 4
  • 27
  • 42
  • This works but yea it does clutter the logs. Let's see if anyone else comes with an alternative solution – wlingke Aug 23 '15 at 18:29
  • I'm not sure how you would expect to run everything in one dyno but not clutter the logs. – hunterloftis Aug 24 '15 at 15:50
  • you can use https://www.npmjs.com/package/winston or similliar libs to output logs not to STDOUT, but to mongo or *sql databases – vodolaz095 Aug 25 '15 at 20:19