skip deleting blob if it doesn't already exist

If it has already disappeard, thre is no need to remove it.

Signed-off-by: cappyzawa <cappyzawa@yahoo.ne.jp>
This commit is contained in:
cappyzawa 2019-11-21 14:27:41 +09:00
parent dee21c0394
commit 04ad58a41f

View file

@ -144,6 +144,10 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis
} }
err = vacuum.RemoveBlob(string(dgst)) err = vacuum.RemoveBlob(string(dgst))
if err != nil { if err != nil {
if _, ok := err.(driver.PathNotFoundError); ok {
emit("skip deleting blob %s: %v", dgst, err)
continue
}
return fmt.Errorf("failed to delete blob %s: %v", dgst, err) return fmt.Errorf("failed to delete blob %s: %v", dgst, err)
} }
} }