From 54c0d0f27d02e8dc2f67b7a5cf3ae5b21f0f0967 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Thu, 7 Nov 2019 10:55:23 +0100 Subject: [PATCH] Fix app context --- app/corpora/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/corpora/events.py b/app/corpora/events.py index 8be48a44..4132bbbf 100644 --- a/app/corpora/events.py +++ b/app/corpora/events.py @@ -27,8 +27,8 @@ def recv_query(message): def observe_corpus_analysis_connection(app, corpus_id, session_id): logger = logging.getLogger(__name__) - corpus = Corpus.query.filter_by(id=corpus_id).first() with app.app_context(): + corpus = Corpus.query.filter_by(id=corpus_id).first() cqi_client = CQiClient(host=corpus.analysis_container_ip) cqi_client.ctrl_connect('opaque', 'opaque') while session_id in connected_sessions: