Skip to content
Snippets Groups Projects

Scheduler

Merged Jake requested to merge scheduler into main
3 files
+ 20
2
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 14
0
@@ -11,6 +11,7 @@ import json
import pprint
from flask import Blueprint, Flask, abort, redirect, render_template, request, session, url_for
from flask_apscheduler import APScheduler
from werkzeug.wrappers import Response
from werkzeug.exceptions import BadRequest, Conflict, Forbidden, Unauthorized
@@ -149,6 +150,19 @@ def create_app(test_config=None):
# Initialize score
score.init_app(app)
# initialize scheduler
scheduler = APScheduler()
scheduler.init_app(app)
@scheduler.task('interval', id='do_verifier', seconds=10, misfire_grace_time=900)
def verifier_job():
with app.app_context():
app.logger.info("Running verifier job")
verifier.verify()
app.logger.info("Finished running verifier job")
scheduler.start()
return app
def get_fragments_blueprint(app: Flask):
Loading