diff --git a/api/s5/s5.go b/api/s5/s5.go index b0e0c3c..d486c93 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -1773,13 +1773,6 @@ func (s *S5API) pinImportCronJob(cid string, url string, proofUrl string, userId return nil } - - // Fetch proof. - proof, err := fetchAndProcess(proofUrl) - if err != nil { - return err // Error logged in fetchAndProcess - } - // Fetch file and process if under post upload limit. if parsedCid.Size <= s.config.Config().Core.PostUploadLimit { fileData, err := fetchAndProcess(url) @@ -1810,6 +1803,12 @@ func (s *S5API) pinImportCronJob(cid string, url string, proofUrl string, userId return nil } + // Fetch proof. + proof, err := fetchAndProcess(proofUrl) + if err != nil { + return err + } + baoProof := bao.Result{ Hash: parsedCid.Hash.HashBytes(), Proof: proof,