mirror of
https://github.com/octoleo/restic.git
synced 2025-02-02 11:58:26 +00:00
Allow overwriting the IndexFull function for tests
This commit is contained in:
parent
af0d6f58b9
commit
4b1a2caea7
@ -64,8 +64,8 @@ const (
|
|||||||
indexMaxAge = 15 * time.Minute
|
indexMaxAge = 15 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
// Full returns true iff the index is "full enough" to be saved as a preliminary index.
|
// IndexFull returns true iff the index is "full enough" to be saved as a preliminary index.
|
||||||
func (idx *Index) Full() bool {
|
var IndexFull = func(idx *Index) bool {
|
||||||
idx.m.Lock()
|
idx.m.Lock()
|
||||||
defer idx.m.Unlock()
|
defer idx.m.Unlock()
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ func (mi *MasterIndex) FullIndexes() []*Index {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if idx.Full() {
|
if IndexFull(idx) {
|
||||||
debug.Log("MasterIndex.FullIndexes", "index %p is full", idx)
|
debug.Log("MasterIndex.FullIndexes", "index %p is full", idx)
|
||||||
list = append(list, idx)
|
list = append(list, idx)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user