From 2aa279f7b6fafb0409caf8bc78e50be3310c784a Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Thu, 17 Nov 2022 16:13:14 -0500 Subject: [PATCH] Upload blob recovery during push --- routers/api/packages/container/blob.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routers/api/packages/container/blob.go b/routers/api/packages/container/blob.go index cbce1c721..85fac0f14 100644 --- a/routers/api/packages/container/blob.go +++ b/routers/api/packages/container/blob.go @@ -75,6 +75,14 @@ func saveAsPackageBlob(hsr packages_module.HashedSizeReader, pi *packages_servic } if exists { fmt.Println("BLOB MODEL EXISTS!!! ", pb.HashSHA256) + _, err := contentStore.Get(packages_module.BlobHash256Key(pb.HashSHA256)) + if err != nil { + fmt.Println("BLOB MODEL and ERR in ContentStore. Resaving Blob to content store ", err.Error()) + if err := contentStore.Save(packages_module.BlobHash256Key(pb.HashSHA256), hsr, hsr.Size()); err != nil { + log.Error("Error saving package blob in content store during FIXITUP: %v", err) + return err + } + } } if !exists { if err := contentStore.Save(packages_module.BlobHash256Key(pb.HashSHA256), hsr, hsr.Size()); err != nil {