diff --git a/daemon/decorators.py b/daemon/decorators.py index 19d80d8ed05e2b6fbc48ee954ad6e210f5762435..040250a87e17cc3a0a0bcf711a94f1ebc3d08b6d 100644 --- a/daemon/decorators.py +++ b/daemon/decorators.py @@ -11,4 +11,4 @@ def background(f): thread = Thread(target=f, args=args, kwargs=kwargs) thread.start() return thread - return wrapped \ No newline at end of file + return wrapped diff --git a/daemon/nopaqued.py b/daemon/nopaqued.py index 537b3e0258026518dd06c9a52782f0c4e50dce6d..2498f75e07f87d1977950598858bd075e45c1a3f 100644 --- a/daemon/nopaqued.py +++ b/daemon/nopaqued.py @@ -4,6 +4,24 @@ from tasks.notify import notify 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(): # executing background functions while True: diff --git a/daemon/tasks/check_jobs.py b/daemon/tasks/check_jobs.py index e699e12e53f2276c3097eb0a033930cbb4adf9be..2b43f0b22f17cfd198b669094a7268ab36a96486 100644 --- a/daemon/tasks/check_jobs.py +++ b/daemon/tasks/check_jobs.py @@ -104,7 +104,6 @@ def __create_job_service(job): def __checkout_job_service(job, scoped_session): logger = init_logger() - scoped_session = Session() service_name = 'job_{}'.format(job.id) try: 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_id=job.id) scoped_session.add(job_result) - scoped_session.commit() def __remove_job_service(job):