mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into development
This commit is contained in:
		@@ -11,4 +11,4 @@ def background(f):
 | 
				
			|||||||
        thread = Thread(target=f, args=args, kwargs=kwargs)
 | 
					        thread = Thread(target=f, args=args, kwargs=kwargs)
 | 
				
			||||||
        thread.start()
 | 
					        thread.start()
 | 
				
			||||||
        return thread
 | 
					        return thread
 | 
				
			||||||
    return wrapped
 | 
					    return wrapped
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,24 @@ from tasks.notify import notify
 | 
				
			|||||||
from time import sleep
 | 
					from time import sleep
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# TODO: Check if thread is still alive and execute next thread after that
 | 
				
			||||||
 | 
					# TODO: Remove unnecessary commits
 | 
				
			||||||
 | 
					# TODO: Check line length
 | 
				
			||||||
 | 
					# check_jobs_thread = None
 | 
				
			||||||
 | 
					# check_corpora_thread = None
 | 
				
			||||||
 | 
					# notify_thread = None
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# def nopaqued():
 | 
				
			||||||
 | 
					#     # executing background functions
 | 
				
			||||||
 | 
					#     while True:
 | 
				
			||||||
 | 
					#         check_jobs_thread = check_jobs()
 | 
				
			||||||
 | 
					#         check_corpora_thread = check_corpora()
 | 
				
			||||||
 | 
					#         notify_thread = notify(True)  # If True mails are sent. If False no mails are sent.
 | 
				
			||||||
 | 
					#         # But notification status will be set nonetheless.
 | 
				
			||||||
 | 
					#         sleep(3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def nopaqued():
 | 
					def nopaqued():
 | 
				
			||||||
    # executing background functions
 | 
					    # executing background functions
 | 
				
			||||||
    while True:
 | 
					    while True:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -104,7 +104,6 @@ def __create_job_service(job):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
def __checkout_job_service(job, scoped_session):
 | 
					def __checkout_job_service(job, scoped_session):
 | 
				
			||||||
    logger = init_logger()
 | 
					    logger = init_logger()
 | 
				
			||||||
    scoped_session = Session()
 | 
					 | 
				
			||||||
    service_name = 'job_{}'.format(job.id)
 | 
					    service_name = 'job_{}'.format(job.id)
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        service = docker_client.services.get(service_name)
 | 
					        service = docker_client.services.get(service_name)
 | 
				
			||||||
@@ -136,7 +135,6 @@ def __checkout_job_service(job, scoped_session):
 | 
				
			|||||||
                job_result = JobResult(dir=results_dir, filename=result,
 | 
					                job_result = JobResult(dir=results_dir, filename=result,
 | 
				
			||||||
                                       job_id=job.id)
 | 
					                                       job_id=job.id)
 | 
				
			||||||
                scoped_session.add(job_result)
 | 
					                scoped_session.add(job_result)
 | 
				
			||||||
    scoped_session.commit()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def __remove_job_service(job):
 | 
					def __remove_job_service(job):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user