Merge pull request #4019 from lllusion3469/patch-3

#3767: Prioritize md5 check over source download
This commit is contained in:
Albert Yi
2018-12-17 10:07:46 -08:00
committed by GitHub

View File

@@ -33,25 +33,25 @@ class UploadService
memoize :canonical_source
def in_progress?
if Utils.is_downloadable?(source)
return Upload.where(status: "preprocessing", source: source).exists?
end
if md5.present?
return Upload.where(status: "preprocessing", md5: md5).exists?
end
if Utils.is_downloadable?(source)
return Upload.where(status: "preprocessing", source: source).exists?
end
false
end
def predecessor
if Utils.is_downloadable?(source)
return Upload.where(status: ["preprocessed", "preprocessing"], source: source).first
end
if md5.present?
return Upload.where(status: ["preprocessed", "preprocessing"], md5: md5).first
end
if Utils.is_downloadable?(source)
return Upload.where(status: ["preprocessed", "preprocessing"], source: source).first
end
end
def completed?