diff --git a/core/db/__init__.py b/core/db/__init__.py index a7f5ac5..7bddda1 100644 --- a/core/db/__init__.py +++ b/core/db/__init__.py @@ -253,7 +253,6 @@ class StorageBackend(ABC): "took": time_took_rounded, "cache": True, } - print("S2", search_query) response = self.run_query(user, search_query, **kwargs) # For Elasticsearch diff --git a/core/db/manticore.py b/core/db/manticore.py index f897af8..09b4bb5 100644 --- a/core/db/manticore.py +++ b/core/db/manticore.py @@ -57,7 +57,6 @@ class ManticoreBackend(StorageBackend): "limit": size, "query": {"bool": {"must": []}}, } - print("BASE", query_base) query_string = { "query_string": query, } @@ -77,7 +76,6 @@ class ManticoreBackend(StorageBackend): raw = kwargs.get("raw") if search_query and not raw: search_query["index"] = index - pprint(search_query) path = kwargs.get("path", "json/search") @@ -98,7 +96,6 @@ class ManticoreBackend(StorageBackend): """ index = kwargs.get("index") search_query["index"] = index - pprint(search_query) async with httpx.AsyncClient() as client: response = await client.post( f"{settings.MANTICORE_URL}/json/search", json=search_query diff --git a/core/db/processing.py b/core/db/processing.py index 2d1b4b4..075b05b 100644 --- a/core/db/processing.py +++ b/core/db/processing.py @@ -94,7 +94,7 @@ def parse_results(results, meta=None): del element[field] # Unfold the tokens if "tokens" in element: - if element["tokens"].startswith('["'): + if element["tokens"].startswith('["') or element["tokens"].startswith("['"): tokens_parsed = ast.literal_eval(element["tokens"]) element["tokens"] = tokens_parsed diff --git a/core/lib/context.py b/core/lib/context.py index d9fc58b..a140734 100644 --- a/core/lib/context.py +++ b/core/lib/context.py @@ -85,5 +85,4 @@ def construct_query(index, net, channel, src, num, size, type=None, nicks=None): if extra_should2: query["query"]["bool"]["must"].append({"bool": {"should": [*extra_should2]}}) - print("CONTEXT QUERY", query) return query diff --git a/core/lib/parsing.py b/core/lib/parsing.py index 2d5076f..0b5cb60 100644 --- a/core/lib/parsing.py +++ b/core/lib/parsing.py @@ -91,7 +91,6 @@ def parse_index(user, query_params, raise_error=False): else: index = settings.INDEX_MAIN - print("GOT INDEX", index) return index diff --git a/core/management/commands/scheduling.py b/core/management/commands/scheduling.py index 28b4325..36934cf 100644 --- a/core/management/commands/scheduling.py +++ b/core/management/commands/scheduling.py @@ -44,8 +44,11 @@ class Command(BaseCommand): for interval in INTERVALS: log.debug(f"Scheduling {interval} second job") scheduler.add_job(job, "interval", seconds=interval, args=[interval]) + + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + scheduler._eventloop = loop scheduler.start() - loop = asyncio.get_event_loop() try: loop.run_forever() except (KeyboardInterrupt, SystemExit): diff --git a/core/templates/partials/sentiment_chart.html b/core/templates/partials/sentiment_chart.html index c7d2427..e42918a 100644 --- a/core/templates/partials/sentiment_chart.html +++ b/core/templates/partials/sentiment_chart.html @@ -3,7 +3,7 @@ {% if params.index != 'int' and params.index != 'meta' %} -