search

Home  >  Q&A  >  body text

python - 如何在Flask应用中,执行定时任务。比如:每30秒执行某个任务?

如何在Flask应用中,执行定时任务。比如:每30秒执行某个任务?

黄舟黄舟2803 days ago928

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 14:47:11

    • Shell scripts can be executed through crontab
    • Use Timer under threading to implement a Scheduler yourself. Here is an example https://gist.github.com/chadselph/4ff85c8c4f68aa105f4b
    • Use celery.

    reply
    0
  • Cancelreply