From 23e8c407dbae2cb0b232c4bb04aafe653dfbe7b3 Mon Sep 17 00:00:00 2001 From: martynia Date: Fri, 20 Sep 2024 08:36:36 +0100 Subject: [PATCH] feat: define index based on pilotID --- diracx-db/src/diracx/db/os/pilot_logs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diracx-db/src/diracx/db/os/pilot_logs.py b/diracx-db/src/diracx/db/os/pilot_logs.py index afaf7ab1..e4080268 100644 --- a/diracx-db/src/diracx/db/os/pilot_logs.py +++ b/diracx-db/src/diracx/db/os/pilot_logs.py @@ -15,4 +15,5 @@ class PilotLogsDB(BaseOSDB): def index_name(self, doc_id: int) -> str: # TODO decide how to define the index name - return f"{self.index_prefix}_0" + # use pilot ID + return f"{self.index_prefix}_{doc_id // 1e6:.0f}"