mirror of
https://github.com/restic/restic.git
synced 2025-11-15 05:23:46 +00:00
Simplify cache logic
This commit is contained in:
@@ -100,6 +100,18 @@ func (mi *MasterIndex) Has(bh restic.BlobHandle) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (mi *MasterIndex) IsMixedPack(packID restic.ID) bool {
|
||||
mi.idxMutex.RLock()
|
||||
defer mi.idxMutex.RUnlock()
|
||||
|
||||
for _, idx := range mi.idx {
|
||||
if idx.MixedPacks().Has(packID) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Packs returns all packs that are covered by the index.
|
||||
// If packBlacklist is given, those packs are only contained in the
|
||||
// resulting IDSet if they are contained in a non-final (newly written) index.
|
||||
|
||||
Reference in New Issue
Block a user