Add some fixes

This commit is contained in:
Stephan Porada 2019-11-07 13:56:21 +01:00
parent 7efe39cbd5
commit 7233c74dca
3 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@ from flask import current_app, request
from flask_login import login_required
from .CQiClient.CQiClient import CQiClient
import logging
import time
@socketio.on('init_corpus_analysis')
@ -28,7 +29,9 @@ def recv_query(message):
def observe_corpus_analysis_connection(app, corpus_id, session_id):
logger = logging.getLogger(__name__)
with app.app_context():
time.sleep(5) # wait for IP of container only for dev
corpus = Corpus.query.filter_by(id=corpus_id).first()
logger.warning('IP adress is: {}'.format(corpus.analysis_container_ip))
cqi_client = CQiClient(host=corpus.analysis_container_ip)
cqi_client.ctrl_connect('opaque', 'opaque')
while session_id in connected_sessions:

View File

@ -64,8 +64,6 @@ def user_ressource_subscription_handler(app, user_id, session_id,
' The JSON patches are send as update-* events.
' > where '*' is either 'corpora' or 'jobs'
'''
logger = logging.getLogger(__name__)
logger.warning('user_id: {}, foreign: {}'.format(user_id, foreign))
init_events = {'corpora': 'init-foreign-corpora' if foreign
else 'init-corpora',
'jobs': 'init-foreign-jobs' if foreign else 'init-jobs'}

View File

@ -68,7 +68,7 @@
analyseBtn.classList.remove('hide');
analyseBtn.classList.add('disabled');
}
if (status === 'prepared' || status === 'start analysis' || status === 'analysing' || status === 'stop analysis') {
if (status === 'prepared' || status === 'preparable' || status === 'preparing' || status === 'start analysis' || status === 'analysing' || status === 'stop analysis') {
var prepareBtn = document.getElementById('prepare');
prepareBtn.classList.add('hide');
}