Skip to content

Commit

Permalink
Add delay after index deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkoKauhanen committed Jan 3, 2025
1 parent 8786217 commit 20f23ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aoe-infra/environments/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions aoe-web-backend/src/search/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export const deleteIndex = async (index: string): Promise<boolean> => {
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) {
Expand Down

0 comments on commit 20f23ee

Please sign in to comment.