mirror of https://github.com/perkeep/perkeep.git
index: GetDirMembers, forgot to close iterator
Could fix too many open files problem with sqlite reported by ajft Change-Id: Icde85b11dcd96a336d1bba1e15a7665a1b4a874a
This commit is contained in:
parent
1decd09846
commit
6cf55d78b0
|
@ -678,11 +678,12 @@ func (x *Index) EdgesTo(ref blob.Ref, opts *search.EdgesToOpts) (edges []*search
|
|||
}
|
||||
|
||||
// GetDirMembers sends on dest the children of the static directory dir.
|
||||
func (x *Index) GetDirMembers(dir blob.Ref, dest chan<- blob.Ref, limit int) error {
|
||||
func (x *Index) GetDirMembers(dir blob.Ref, dest chan<- blob.Ref, limit int) (err error) {
|
||||
defer close(dest)
|
||||
|
||||
sent := 0
|
||||
it := x.queryPrefix(keyStaticDirChild, dir.String())
|
||||
defer closeIterator(it, &err)
|
||||
for it.Next() {
|
||||
keyPart := strings.Split(it.Key(), "|")
|
||||
if len(keyPart) != 3 {
|
||||
|
|
Loading…
Reference in New Issue