Skip to content

Commit

Permalink
Repurpose pulp_last_updated to failed_at (on-demand stream)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pedro-psb committed Jan 14, 2025
1 parent ad00328 commit 3fadd47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3fadd47

Please sign in to comment.