[英]How can I run two scripts on Heroku?
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.我正在构建一个 Dash Webapp,我有两个 Python 脚本:一个是主 Dash 应用程序,另一个脚本应该用于检索数据。
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.由于我无法在一个脚本上“合并”我的两个脚本,我决定让第二个脚本将我的数据发送到数据库,而 Dash 脚本通过数据库查询接收此数据。
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?现在我需要在线部署它并使两个脚本并行运行,因为一个将数据提供给数据库,另一个将获取此数据并将其绘制在网页上,但是否可以同时运行两个 Python 文件在平行下? 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)?
我可以在单个 dyno 上完成,还是应该使用两个不同的应用程序(一个用于 webapp,另一个用于数据)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.