Skip to content

Commit

Permalink
fix fetching data with 1 record
Browse files Browse the repository at this point in the history
  • Loading branch information
ykomissarov committed Nov 19, 2019
1 parent 7582328 commit a60a23b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions model/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func concurrentFetchData(tableName string, batchSize int, f func(list []entity.T

shiftId := idSection.FirstId / batchSize
queriesCount := int(math.Ceil(float64(idSection.LastId-idSection.FirstId) / float64(batchSize)))
if queriesCount == 0 {
queriesCount = 1
}
currentQuery := atomic.NewAtomicInt(0)
fetching := atomic.NewAtomicBool(true)
goroutinesCount := runtime.NumCPU() * runtime.NumCPU()
Expand Down

0 comments on commit a60a23b

Please sign in to comment.