From e99ae518900b6e38bdea904cef3fa729f0b35b40 Mon Sep 17 00:00:00 2001 From: Julien Richard Date: Tue, 28 Jan 2025 17:21:20 +0100 Subject: [PATCH] [backend] Prevent prepareElementForIndexing to block event loop --- opencti-platform/opencti-graphql/src/database/engine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencti-platform/opencti-graphql/src/database/engine.js b/opencti-platform/opencti-graphql/src/database/engine.js index 4cf46944ce97..8dfba7c0b5ff 100644 --- a/opencti-platform/opencti-graphql/src/database/engine.js +++ b/opencti-platform/opencti-graphql/src/database/engine.js @@ -3880,7 +3880,7 @@ export const prepareElementForIndexing = async (element) => { if (isDateAttribute(key)) { // Date is an object but natively supported preparedArray.push(valueElement); } else if (R.is(String, valueElement)) { // For string, trim by default - return preparedArray.push(valueElement.trim()); + preparedArray.push(valueElement.trim()); } else if (R.is(Object, valueElement) && Object.keys(value).length > 0) { // For complex object, prepare inner elements const complexPrepared = await prepareElementForIndexing(valueElement); preparedArray.push(complexPrepared);