From 0861d931cebd83337da6a521e74b926a232c360c Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Tue, 24 Aug 2021 09:50:32 +0200
Subject: [PATCH] Add an abort criterion when exporting query results

---
 app/corpora/events.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/corpora/events.py b/app/corpora/events.py
index 907bcc93..e0a88062 100644
--- a/app/corpora/events.py
+++ b/app/corpora/events.py
@@ -245,6 +245,8 @@ def corpus_analysis_get_match_with_full_context(payload):
     i = 0
     # Send data one match at a time.
     for index, f_cpos, l_cpos in zip(data_indexes, first_cpos, last_cpos):
+        if client.status == 'abort':
+            break
         i += 1
         matches = []
         cpos_lookup = text_lookup = {}
-- 
GitLab