Update background functions

This commit is contained in:
Patrick Jentsch
2019-11-14 13:40:05 +01:00
parent 7dd55c47a0
commit 1b02d73d66
7 changed files with 31 additions and 42 deletions

View File

@ -0,0 +1,9 @@
from app.models import Job
def delete_job_(app, job_id):
with app.app_context():
job = Job.query.filter_by(id=job_id).first()
if job is None:
raise Exception('Job {} not found!'.format(job_id))
job.delete()

View File

@ -1,9 +1,9 @@
from app.models import Job, JobInput, JobResult
from app.background_functions import delete_job_
from flask import (abort, current_app, flash, redirect, render_template,
send_from_directory, url_for)
from flask_login import current_user, login_required
from . import jobs
from .background_functions import delete_job_
import os
import threading