swarm/storage: move close to correct place

This commit is contained in:
Anton Evangelatov 2018-04-11 12:51:17 +03:00
parent 03412e0ea6
commit bb741ccf15
2 changed files with 1 additions and 6 deletions

View file

@ -618,11 +618,11 @@ func (s *LDBStore) writeBatches() {
if err != nil { if err != nil {
log.Error(fmt.Sprintf("DbStore: spawn batch write (%d chunks): %v", b.Len(), err)) log.Error(fmt.Sprintf("DbStore: spawn batch write (%d chunks): %v", b.Len(), err))
} }
close(c)
if e >= s.capacity { if e >= s.capacity {
log.Trace(fmt.Sprintf("DbStore: collecting garbage...(%d chunks)", e)) log.Trace(fmt.Sprintf("DbStore: collecting garbage...(%d chunks)", e))
s.collectGarbage(gcArrayFreeRatio) s.collectGarbage(gcArrayFreeRatio)
} }
close(c)
} }
log.Trace(fmt.Sprintf("DbStore: quit batch write loop")) log.Trace(fmt.Sprintf("DbStore: quit batch write loop"))
} }

View file

@ -79,11 +79,6 @@ func TestMemStoreAndLDBStore(t *testing.T) {
chunkSize: 4096, chunkSize: 4096,
request: false, request: false,
}, },
{
n: 15001,
chunkSize: 4096,
request: false,
},
//{ //{
//n: 60001, //n: 60001,
//chunkSize: 4096, //chunkSize: 4096,