2020-06-05 12:42:04 +00:00
|
|
|
from tasks.check_jobs import check_jobs
|
|
|
|
from tasks.check_corpora import check_corpora
|
|
|
|
from tasks.notify import notify
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
2020-06-05 13:17:37 +00:00
|
|
|
# TODO: Check if thread is still alive and execute next thread after that
|
|
|
|
# TODO: Remove unnecessary commits
|
|
|
|
# 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)
|
|
|
|
|
|
|
|
|
2020-06-05 12:42:04 +00:00
|
|
|
def nopaqued():
|
|
|
|
# executing background functions
|
|
|
|
while True:
|
|
|
|
check_jobs()
|
|
|
|
check_corpora()
|
|
|
|
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()
|