From 8974dbf275c5dda5e7c2cc4881664266c25c87c8 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 6 Feb 2025 15:03:28 -0500 Subject: [PATCH] await/async order of operations --- astropylibrarian/workflows/expirerecords.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/astropylibrarian/workflows/expirerecords.py b/astropylibrarian/workflows/expirerecords.py index 6dd8e6d..74e6b66 100644 --- a/astropylibrarian/workflows/expirerecords.py +++ b/astropylibrarian/workflows/expirerecords.py @@ -36,7 +36,9 @@ async def expire_old_records( attributes_to_highlight=[], ) old_object_ids: List[str] = [] - for r in await algolia_index.browse_objects(obj).hits: + # for r in await algolia_index.browse_objects(obj).hits: + records = await algolia_index.browse_objects(obj) + for r in records.hits: # Double check that we're deleting the right things. if r.root_url != root_url: logger.warning("root_url does not match: %s", r.root_url)