swarm/storage: set false, only when we get a chunk back (#19599)

This commit is contained in:
Anton Evangelatov
2019-05-31 11:13:34 +02:00
committed by GitHub
parent f2612ac948
commit 30263ad37d
3 changed files with 54 additions and 7 deletions

View File

@@ -93,10 +93,6 @@ func (s *SwarmSyncerServer) SessionIndex() (uint64, error) {
// are added in batchTimeout period, the batch will be returned. This function
// will block until new chunks are received from localstore pull subscription.
func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint64, *HandoverProof, error) {
//TODO: maybe add unit test for intervals usage in netstore/localstore together with SwarmSyncerServer?
if from > 0 {
from--
}
batchStart := time.Now()
descriptors, stop := s.netStore.SubscribePull(context.Background(), s.po, from, to)
defer stop()