mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 09:15:41 +00:00
Codestyle update
This commit is contained in:
parent
dd469386e1
commit
3d8d2b3e48
@ -23,7 +23,7 @@ def create_app(config_name):
|
|||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
login_manager.init_app(app)
|
login_manager.init_app(app)
|
||||||
mail.init_app(app)
|
mail.init_app(app)
|
||||||
socketio.init_app(app, message_qeue='redis://')
|
socketio.init_app(app, message_qeue='redis://redis')
|
||||||
|
|
||||||
from . import events
|
from . import events
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ def corpus_analysis(message):
|
|||||||
def corpus_analysis_session_handler(app, corpus_id, session_id):
|
def corpus_analysis_session_handler(app, corpus_id, session_id):
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
''' Setup analysis session '''
|
''' Setup analysis session '''
|
||||||
logger.warning('[{}] Setup analysis session'.format(session_id))
|
|
||||||
corpus = Corpus.query.get(corpus_id)
|
corpus = Corpus.query.get(corpus_id)
|
||||||
while corpus.status != 'analysing':
|
while corpus.status != 'analysing':
|
||||||
db.session.refresh(corpus)
|
db.session.refresh(corpus)
|
||||||
@ -84,13 +83,12 @@ def corpus_analysis_session_handler(app, corpus_id, session_id):
|
|||||||
corpus_analysis_sessions[corpus_id] = [session_id]
|
corpus_analysis_sessions[corpus_id] = [session_id]
|
||||||
else:
|
else:
|
||||||
corpus_analysis_sessions[corpus_id].append(session_id)
|
corpus_analysis_sessions[corpus_id].append(session_id)
|
||||||
socketio.emit('request_corpus_analysis', '[201]: Created', room=session_id)
|
socketio.emit('request_corpus_analysis', '[201]: Created',
|
||||||
|
room=session_id)
|
||||||
''' Observe analysis session '''
|
''' Observe analysis session '''
|
||||||
while session_id in connected_sessions:
|
while session_id in connected_sessions:
|
||||||
logger.warning('[{}] Observe analysis session'.format(session_id))
|
|
||||||
socketio.sleep(3)
|
socketio.sleep(3)
|
||||||
''' Teardown analysis session '''
|
''' Teardown analysis session '''
|
||||||
logger.warning('[{}] Teardown analysis session'.format(session_id))
|
|
||||||
client.disconnect()
|
client.disconnect()
|
||||||
corpus_analysis_clients.pop(session_id, None)
|
corpus_analysis_clients.pop(session_id, None)
|
||||||
corpus_analysis_sessions[corpus_id].remove(session_id)
|
corpus_analysis_sessions[corpus_id].remove(session_id)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from app import db, logger
|
from app import db
|
||||||
from app.jobs.forms import AddNLPJobForm, AddOCRJobForm
|
from app.jobs.forms import AddNLPJobForm, AddOCRJobForm
|
||||||
from app.models import Job, JobInput
|
from app.models import Job, JobInput
|
||||||
from flask import (abort, current_app, flash, make_response, render_template,
|
from flask import (abort, current_app, flash, make_response, render_template,
|
||||||
request, url_for)
|
url_for)
|
||||||
from flask_login import current_user, login_required
|
from flask_login import current_user, login_required
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
from . import services
|
from . import services
|
||||||
|
Loading…
Reference in New Issue
Block a user