mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-25 03:09:00 -06:00
go/store/datas/pull: pull_chunk_tracker.go: PR feedback: Round out the last batch returned from GetChunksToFetch.
This commit is contained in:
@@ -194,9 +194,17 @@ func (t *PullChunkTracker) reqRespThread(initial hash.HashSet) {
|
||||
req.hs = absent[0]
|
||||
var i int
|
||||
for i = 1; i < len(absent); i++ {
|
||||
if len(req.hs)+len(absent[i]) < t.cfg.BatchSize {
|
||||
l := len(absent[i])
|
||||
if len(req.hs)+l < t.cfg.BatchSize {
|
||||
req.hs.InsertAll(absent[i])
|
||||
} else {
|
||||
for h := range absent[i] {
|
||||
if len(req.hs) >= t.cfg.BatchSize {
|
||||
break
|
||||
}
|
||||
req.hs.Insert(h)
|
||||
absent[i].Remove(h)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user