From 20f23ee7aa2ac612fcd5b3c465910faa5aa9cd5d Mon Sep 17 00:00:00 2001 From: Mikko Kauhanen Date: Thu, 2 Jan 2025 16:52:48 +0200 Subject: [PATCH] Add delay after index deletion --- aoe-infra/environments/dev.json | 2 +- aoe-web-backend/src/search/es.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aoe-infra/environments/dev.json b/aoe-infra/environments/dev.json index 7e3bca9c..4ecb3ab9 100644 --- a/aoe-infra/environments/dev.json +++ b/aoe-infra/environments/dev.json @@ -74,7 +74,7 @@ "memory_limit": "1024", "min_count": 1, "max_count": 1, - "image_tag": "ga-230", + "image_tag": "ga-242", "allow_ecs_exec": true, "env_vars": { "PID_SERVICE_URL": "http://localhost", diff --git a/aoe-web-backend/src/search/es.ts b/aoe-web-backend/src/search/es.ts index 3fd2db5e..ea0e0895 100644 --- a/aoe-web-backend/src/search/es.ts +++ b/aoe-web-backend/src/search/es.ts @@ -106,6 +106,9 @@ export const deleteIndex = async (index: string): Promise => { return false; } + // delay added due to opensearch serverless issue with old index still being used for bulk + await new Promise((resolve) => setTimeout(resolve, 2000)); + for (let attempt = 0; attempt < 5; attempt++) { const exists = await indexExists(index); if (!exists) {