mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
21 lines
481 B
Python
21 lines
481 B
Python
from app import db
|
|
from time import sleep
|
|
from .corpus_utils import CheckCorporaMixin
|
|
from .job_utils import CheckJobsMixin
|
|
import docker
|
|
|
|
|
|
class Daemon(CheckCorporaMixin, CheckJobsMixin):
|
|
def __init__(self):
|
|
self.docker = docker.from_env()
|
|
|
|
def run(self):
|
|
while True:
|
|
try:
|
|
self.check_corpora()
|
|
self.check_jobs()
|
|
db.session.commit()
|
|
except:
|
|
pass
|
|
sleep(1.5)
|