From 2570bd9e26866c24ddc9791b101012fd2dca5fe7 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Wed, 18 May 2022 10:18:23 +0300 Subject: [PATCH] Fix ES issue with capital letters in index name --- apiserver/bll/queue/queue_metrics.py | 2 +- apiserver/bll/workers/stats.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/bll/queue/queue_metrics.py b/apiserver/bll/queue/queue_metrics.py index b259049..03bc129 100644 --- a/apiserver/bll/queue/queue_metrics.py +++ b/apiserver/bll/queue/queue_metrics.py @@ -29,7 +29,7 @@ class QueueMetrics: @staticmethod def _queue_metrics_prefix_for_company(company_id: str) -> str: """Returns the es index prefix for the company""" - return f"queue_metrics_{company_id}_" + return f"queue_metrics_{company_id.lower()}_" @staticmethod def _get_es_index_suffix(): diff --git a/apiserver/bll/workers/stats.py b/apiserver/bll/workers/stats.py index 1454fe1..1a9d8af 100644 --- a/apiserver/bll/workers/stats.py +++ b/apiserver/bll/workers/stats.py @@ -20,7 +20,7 @@ class WorkerStats: @staticmethod def worker_stats_prefix_for_company(company_id: str) -> str: """Returns the es index prefix for the company""" - return f"worker_stats_{company_id}_" + return f"worker_stats_{company_id.lower()}_" def _search_company_stats(self, company_id: str, es_req: dict) -> dict: return self.es.search(