nopaque/app/scheduler/views.py
2019-07-10 14:20:22 +02:00

22 lines
561 B
Python

from flask import render_template
from . import scheduler
from flask_login import current_user, login_required
from .. import background_scheduler
import json
@scheduler.route('/')
@login_required
def scheduler():
job = {
'creator': current_user.id,
'files': ['file_1', 'file_2', 'file_3'],
'service': 'ocr',
'args': {
'lang': 'deu'
}
}
job = background_scheduler.add_job(print, trigger='date', args=[job])
print(job)
return render_template('scheduler/index.html.j2', title='Scheduler')