0

I'm building a Dash Webapp, I have two Python scripts: one is the main Dash app and the other script is supposed to retrieve data.

Since I can't "merge" my two scripts on one, I decided to have the second script send my data to a Database while the Dash script receives this data with a DB query.

Now I need to deploy it online and have both the scripts running in parallel, since one will feed data to the DB and the other one will fetch this data and chart it on a webpage, but is it possible to run at once two Python files in parallel? Can I do it on a single dyno or should I use two different apps (one for the webapp and another one for the data)?

petezurich
  • 9,280
  • 9
  • 43
  • 57
Jack022
  • 867
  • 6
  • 30
  • 91

1 Answers1

1

Check this. It says:

The quickest way maybe to list the commands to run, each followed by an &, with a wait -n in the end, in the Procfile, e.g.:

web: puma -C config/puma.rb & sidekiq & wait -n

Cheche
  • 1,456
  • 10
  • 27
  • 1
    @Jack022 ok. Let me know if it works. Also try to define multiple workers in your Procfile, check [this](https://stackoverflow.com/q/22989339/10322652) – Cheche Nov 09 '18 at 22:33