mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
26 lines
742 B
Python
26 lines
742 B
Python
from concurrent.futures import ThreadPoolExecutor
|
|
from tasks.check_corpora import check_corpora
|
|
from tasks.check_jobs import check_jobs
|
|
from tasks.notify import notify
|
|
from time import sleep
|
|
|
|
|
|
# TODO: Check if thread is still alive and execute next thread after that
|
|
# TODO: Check line length
|
|
|
|
|
|
def nopaqued():
|
|
# executing background functions
|
|
while True:
|
|
with ThreadPoolExecutor(max_workers=3) as executor:
|
|
executor.submit(check_jobs)
|
|
executor.submit(check_corpora)
|
|
executor.submit(notify, True) # If True mails are sent.
|
|
# If False no mails are sent.
|
|
# But notification status will be set nonetheless.
|
|
sleep(3)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
nopaqued()
|