From 3fadd477e0b93bc7b42652190f8ede424e0be759 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Tue, 14 Jan 2025 13:53:46 -0300 Subject: [PATCH] Repurpose pulp_last_updated to failed_at (on-demand stream) As we can't backport the RemoteArtifact.failed_at field, we are using the pulp_last_updated for the same purpose. We assume this field is not actively used in any part of the system. --- pulpcore/content/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pulpcore/content/handler.py b/pulpcore/content/handler.py index 390122da50..41d91b919b 100644 --- a/pulpcore/content/handler.py +++ b/pulpcore/content/handler.py @@ -827,7 +827,7 @@ async def _stream_content_artifact(self, request, response, content_artifact): remote_artifacts = ( content_artifact.remoteartifact_set.select_related("remote") .order_by_acs() - .exclude(failed_at__gte=timezone.now() - timedelta(seconds=protection_time)) + .exclude(pulp_last_updated__gte=timezone.now() - timedelta(seconds=protection_time)) ) async for remote_artifact in remote_artifacts: try: @@ -1126,7 +1126,7 @@ async def finalize(): try: download_result = await downloader.run() except DigestValidationError: - remote_artifact.failed_at = timezone.now() + remote_artifact.pulp_last_updated = timezone.now() await remote_artifact.asave() await downloader.session.close() close_tcp_connection(request.transport._sock)