Upload blob recovery during push

This commit is contained in:
Michael Shaw 2022-11-17 16:13:14 -05:00
parent c549dac100
commit 2aa279f7b6

View File

@ -75,6 +75,14 @@ func saveAsPackageBlob(hsr packages_module.HashedSizeReader, pi *packages_servic
} }
if exists { if exists {
fmt.Println("BLOB MODEL EXISTS!!! ", pb.HashSHA256) 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 !exists {
if err := contentStore.Save(packages_module.BlobHash256Key(pb.HashSHA256), hsr, hsr.Size()); err != nil { if err := contentStore.Save(packages_module.BlobHash256Key(pb.HashSHA256), hsr, hsr.Size()); err != nil {