How to schedule a function to run every hour on Flask?

前端 未结 9 2318
我寻月下人不归
我寻月下人不归 2020-11-28 01:10

I have a Flask web hosting with no access to cron command.

How can I execute some Python function every hour?

9条回答
  •  暖寄归人
    2020-11-28 01:46

    Another alternative might be to use Flask-APScheduler which plays nicely with Flask, e.g.:

    • Loads scheduler configuration from Flask configuration,
    • Loads job definitions from Flask configuration

    More information here:

    https://pypi.python.org/pypi/Flask-APScheduler

提交回复
热议问题