Skip to content
Snippets Groups Projects
Commit 34499643 authored by Stephan Porada's avatar Stephan Porada :speech_balloon:
Browse files

Put execute_flag into enviroment file

parent 4727ce32
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ from concurrent.futures import ThreadPoolExecutor ...@@ -2,6 +2,7 @@ from concurrent.futures import ThreadPoolExecutor
from tasks.check_corpora import check_corpora from tasks.check_corpora import check_corpora
from tasks.check_jobs import check_jobs from tasks.check_jobs import check_jobs
from tasks.notify import notify from tasks.notify import notify
import os
# TODO: Check if thread is still alive and execute next thread after that # TODO: Check if thread is still alive and execute next thread after that
...@@ -9,13 +10,15 @@ from tasks.notify import notify ...@@ -9,13 +10,15 @@ from tasks.notify import notify
def nopaqued(): def nopaqued():
execute_notifications = os.environ.get('NOPAQUE_EXECUTE_NOTIFICATIONS')
# executing background functions # executing background functions
while True: while True:
with ThreadPoolExecutor(max_workers=3) as executor: with ThreadPoolExecutor(max_workers=3) as executor:
executor.submit(check_jobs) executor.submit(check_jobs)
executor.submit(check_corpora) executor.submit(check_corpora)
executor.submit(notify, True) # If True mails are sent. executor.submit(notify, execute_notifications)
# If False no mails are sent. # If execute_notifications True mails are sent.
# If execute_notifications False no mails are sent.
# But notification status will be set nonetheless. # But notification status will be set nonetheless.
......
...@@ -27,6 +27,7 @@ NOPAQUE_DOMAIN= ...@@ -27,6 +27,7 @@ NOPAQUE_DOMAIN=
NOPAQUE_LOG_LEVEL= NOPAQUE_LOG_LEVEL=
NOPAQUE_MAIL_SENDER= NOPAQUE_MAIL_SENDER=
NOPAQUE_STORAGE= NOPAQUE_STORAGE=
NOPAQUE_EXECUTE_NOTIFICATIONS=
### PostgreSQL ### ### PostgreSQL ###
POSTGRES_DB_NAME= POSTGRES_DB_NAME=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment