Allow overwriting the IndexFull function for tests

This commit is contained in:
Alexander Neumann 2015-10-25 15:05:22 +01:00
parent af0d6f58b9
commit 4b1a2caea7
2 changed files with 3 additions and 3 deletions

View file

@ -64,8 +64,8 @@ const (
indexMaxAge = 15 * time.Minute
)
// Full returns true iff the index is "full enough" to be saved as a preliminary index.
func (idx *Index) Full() bool {
// IndexFull returns true iff the index is "full enough" to be saved as a preliminary index.
var IndexFull = func(idx *Index) bool {
idx.m.Lock()
defer idx.m.Unlock()

View file

@ -206,7 +206,7 @@ func (mi *MasterIndex) FullIndexes() []*Index {
continue
}
if idx.Full() {
if IndexFull(idx) {
debug.Log("MasterIndex.FullIndexes", "index %p is full", idx)
list = append(list, idx)
} else {