mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +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)
|
||||
login_manager.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
|
||||
|
||||
|
@ -72,7 +72,6 @@ def corpus_analysis(message):
|
||||
def corpus_analysis_session_handler(app, corpus_id, session_id):
|
||||
with app.app_context():
|
||||
''' Setup analysis session '''
|
||||
logger.warning('[{}] Setup analysis session'.format(session_id))
|
||||
corpus = Corpus.query.get(corpus_id)
|
||||
while corpus.status != 'analysing':
|
||||
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]
|
||||
else:
|
||||
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 '''
|
||||
while session_id in connected_sessions:
|
||||
logger.warning('[{}] Observe analysis session'.format(session_id))
|
||||
socketio.sleep(3)
|
||||
''' Teardown analysis session '''
|
||||
logger.warning('[{}] Teardown analysis session'.format(session_id))
|
||||
client.disconnect()
|
||||
corpus_analysis_clients.pop(session_id, None)
|
||||
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.models import Job, JobInput
|
||||
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 werkzeug.utils import secure_filename
|
||||
from . import services
|
||||
|
Loading…
Reference in New Issue
Block a user