From 8f20125059c012c37c92cd152f0f1bd61d6825fd Mon Sep 17 00:00:00 2001 From: s-hertel <19572925+s-hertel@users.noreply.github.com> Date: Fri, 14 Nov 2025 11:53:44 -0500 Subject: [PATCH] Restore resetting expired cache Don't reset paginated responses mid-pagination --- lib/ansible/galaxy/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index 85c4331e215..cb182f7d7d0 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -379,6 +379,7 @@ class GalaxyAPI: # The cache entry had expired or does not exist, start a new blank entry to be filled later. expires = datetime.datetime.now(datetime.timezone.utc) expires += datetime.timedelta(days=1) + server_cache.pop(cache_key, None) headers = headers or {} self._add_auth_token(headers, url, required=auth_required) @@ -400,7 +401,7 @@ class GalaxyAPI: % (resp.url, to_native(resp_data))) if cache and self._cache: - if not valid: + if not valid and not is_paginated_url: server_cache[cache_key] = { 'expires': expires.strftime(iso_datetime_format), 'paginated': False,