mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-01 10:20:34 +00:00
Move sheduler start logic
This commit is contained in:
23
wsgi.py
23
wsgi.py
@ -8,20 +8,6 @@ from flask import Flask # noqa
|
||||
from typing import Any, Dict # noqa
|
||||
from app import create_app, db, scheduler, socketio # noqa
|
||||
from app import models # noqa
|
||||
# from app.models import (
|
||||
# Avatar,
|
||||
# Corpus,
|
||||
# CorpusFile,
|
||||
# CorpusFollowerAssociation,
|
||||
# CorpusFollowerRole,
|
||||
# Job,
|
||||
# JobInput,
|
||||
# JobResult,
|
||||
# Role,
|
||||
# TesseractOCRPipelineModel,
|
||||
# SpaCyNLPPipelineModel,
|
||||
# User
|
||||
# ) # noqa
|
||||
|
||||
|
||||
app: Flask = create_app()
|
||||
@ -48,12 +34,9 @@ def make_shell_context() -> Dict[str, Any]:
|
||||
|
||||
|
||||
def main():
|
||||
with app.app_context():
|
||||
if app.config['NOPAQUE_IS_PRIMARY_INSTANCE']:
|
||||
for corpus in models.Corpus.query.filter(models.Corpus.num_analysis_sessions > 0).all():
|
||||
corpus.num_analysis_sessions = 0
|
||||
db.session.commit()
|
||||
scheduler.start()
|
||||
if app.config['NOPAQUE_IS_PRIMARY_INSTANCE']:
|
||||
with app.app_context():
|
||||
scheduler.start()
|
||||
socketio.run(app, host='0.0.0.0')
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user