Project

Profile

Help

Issue #1481

closed

Add the ability to abort downloads in the `download_started` event.

Added by jcline@redhat.com over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Nectar:
Platform Release:
Target Release - Nectar:
1.4.4
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The lazy download tasks check to see if files are present on disk when the `download_started` event is called. I'd like to be able halt a download in the `download_started` event if, say, the file exists and its checksum is what I expect. I would like to do this by raising some exception (SkipLocation looks like a likely candidate, though it appears to be used when the location isn't reachable, so maybe it's not appropriate.

The reason this is currently impossible is that the `download_started` call happens outside of the big try block: https://github.com/pulp/nectar/tree/5559de52c23e89a35d80febe38981c352a9cf5b0/nectar/downloaders/threaded.py#L205

Also available in: Atom PDF