Skip to content

Commit 88cab57

Browse files
committed
try fix for tuple indexing error
1 parent 4725f1a commit 88cab57

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

astropylibrarian/workflows/expirerecords.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def expire_old_records(
2727
filters = (
2828
f"root_url:{escape_facet_value(root_url)}"
2929
" AND NOT "
30-
f"root_url:{escape_facet_value(root_url)}"
30+
f"index_epoch:{escape_facet_value(index_epoch)}"
3131
)
3232

3333
obj = BrowseParamsObject(
@@ -36,12 +36,12 @@ async def expire_old_records(
3636
attributes_to_highlight=[],
3737
)
3838
old_object_ids: List[str] = []
39-
for r in await algolia_index.browse_objects(obj):
39+
async for r in algolia_index.browse_objects(obj):
4040
# Double check that we're deleting the right things.
4141
if r["root_url"] != root_url:
42-
logger.warning("root_url does not match: %s", r["baseUrl"])
42+
logger.warning("root_url does not match: %s", r["root_url"])
4343
continue
44-
if r["surrogateKey"] == index_epoch:
44+
if r["index_epoch"] == index_epoch:
4545
logger.warning("index_epoch matches current epoch: %s", r["index_epoch"])
4646
continue
4747
old_object_ids.append(r["objectID"])
@@ -56,4 +56,4 @@ async def expire_old_records(
5656

5757
logger.info("Finished deleting expired objects for %s", root_url)
5858

59-
return old_object_ids
59+
return old_object_ids

0 commit comments

Comments
 (0)