Running Heroku background tasks with only 1 web dyno and 0 worker dynos

后端 未结 5 1857
不知归路
不知归路 2020-12-14 02:02

I have a Python Flask app on Heroku that serves web pages but also allows certain tasks to be launched which I believe would be best structured as background tasks. As such

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 02:56

    To start and run a process in background:

    Procfile:

    run: python my_app.py
    

    And later, execute:

    heroku ps:scale run=1
    

提交回复
热议问题