Skip to content

Commit 3d88ca6

Browse files
authored
Merge pull request #56 from astropy/learn_site_fix
Attempted fix of learn-astropy workflow failure
2 parents e7434f5 + 88cab57 commit 3d88ca6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Mac OS
2+
.DS_Store
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]

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)