Open TanmoySG opened 2 years ago
Scheduled Operation calls within the Flask App can help in performing certain template-operations without the need of Admin-System Interface.
[Parent/Related Component]
AuthLib Maintenance can use scheduled function calls / scheduled operations.
[Checkpoints]
[Additional Details]
Can use APScheduler for in-script scheduling as an alternative to Cron Jobs.
APScheduler
A Sample Implementation of it can be found on this GutHub Gist.
import flask from apscheduler.schedulers.background import BackgroundScheduler def scheduled_function(): print("Scheduled Function Called") sched = BackgroundScheduler(daemon=True) sched.add_job(scheduled_function,'interval',seconds=20) sched.start() app = flask.Flask(__name__) @app.route("/home") def hello_world(): return "<p>Hello, World!</p>"
Documentation
Scheduled Operation calls within the Flask App can help in performing certain template-operations without the need of Admin-System Interface.
[Parent/Related Component]
29
AuthLib Maintenance can use scheduled function calls / scheduled operations.
[Checkpoints]
[Additional Details]
Can use
APScheduler
for in-script scheduling as an alternative to Cron Jobs.A Sample Implementation of it can be found on this GutHub Gist.
Documentation