ckan / ckanext-archiver

Archive CKAN resources
MIT License
21 stars 46 forks source link

Unnecessary tasks created when uploaded resources are modified #77

Open ThrawnCA opened 3 years ago

ThrawnCA commented 3 years ago

The logic for determining whether a resource URL has changed (and therefore needs archiving) doesn't properly handle uploaded files, because the 'new' resource is the plain filename while the 'old' one has the full URL. Editing and saving an uploaded resource without making any further changes will result in an unnecessary archiver task, with a log message similar to:

DEBUG [ckanext.archiver.plugin] Resource url changed - will archive. id=3fbf pos=0 url="https://example.com/dataset/5bc484a7-8773-4301-b925-c7ba7ca5878c/resource/3fbf6fcb-fd65-4c73-b82d-21f53810c788/download/example.pdf"->"example.pdf"