mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-03 20:02:47 +00:00 
			
		
		
		
	Update background functions
This commit is contained in:
		
							
								
								
									
										9
									
								
								app/jobs/background_functions.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								app/jobs/background_functions.py
									
									
									
									
									
										Normal 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()
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user