Skip to content

Commit 192fa32

Browse files
committed
try getting the index
1 parent 2358cfe commit 192fa32

File tree

3 files changed

+29
-82
lines changed

3 files changed

+29
-82
lines changed

packages/indexWaiter/index_waiter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ def handler(event, context):
3737
continue
3838

3939
# 2. Check index
40-
idx_resp = aoss.get_index(indexName=index_name, id=coll.id)
41-
idx = next((i for i in idx_resp.get("indexDetails", []) if i["name"] == index_name), None)
42-
43-
if not idx:
40+
try:
41+
aoss.get_index(indexName=index_name, id=coll["id"])
42+
except aoss.exceptions.ResourceNotFoundException:
4443
logger.warning(
4544
"Index missing", extra={"collection": collection_name, "index": index_name, "attempt": attempt}
4645
)
4746
time.sleep(10)
4847
continue
48+
except Exception:
49+
raise
4950

5051
logger.info(
5152
"Index status check",

0 commit comments

Comments
 (0)