mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
feat(storage): rebuild storage(s3/local) dedupe index when switching dedupe status (#1062)
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Vendored
+11
-3
@@ -22,8 +22,9 @@ type BoltDBDriver struct {
|
||||
}
|
||||
|
||||
type BoltDBDriverParameters struct {
|
||||
RootDir, Name string
|
||||
UseRelPaths bool
|
||||
RootDir string
|
||||
Name string
|
||||
UseRelPaths bool
|
||||
}
|
||||
|
||||
func NewBoltDBCache(parameters interface{}, log zlog.Logger) Cache {
|
||||
@@ -206,10 +207,17 @@ func (d *BoltDBDriver) HasBlob(digest godigest.Digest, blob string) bool {
|
||||
return errors.ErrCacheMiss
|
||||
}
|
||||
|
||||
if origin.Get([]byte(blob)) == nil {
|
||||
deduped := bucket.Bucket([]byte(constants.DuplicatesBucket))
|
||||
if deduped == nil {
|
||||
return errors.ErrCacheMiss
|
||||
}
|
||||
|
||||
if origin.Get([]byte(blob)) == nil {
|
||||
if deduped.Get([]byte(blob)) == nil {
|
||||
return errors.ErrCacheMiss
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}); err != nil {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user