How do I run a long-running job in the background in Python

前端 未结 4 678
情话喂你
情话喂你 2020-12-02 23:56

I have a web-service that runs long-running jobs (in the order of several hours). I am developing this using Flask, Gunicorn, and nginx.

What I am thinking of doing

4条回答
  •  执笔经年
    2020-12-03 00:03

    Celery and RQ is overengineering for simple task. Take a look at this docs - https://docs.python.org/3/library/concurrent.futures.html

    Also check example, how to run long-running jobs in background for Flask app - https://stackoverflow.com/a/39008301/5569578

提交回复
热议问题