Skip to content

Commit

Permalink
bug fix for taking non-existing slice of records
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed May 19, 2022
1 parent 68bdea7 commit fcbb98f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbs/filelumis.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ func InsertFileLumisTxViaChunks(tx *sql.Tx, table string, records []FileLumis) e
var wg sync.WaitGroup
ngoroutines := 0
for i := k; i < k+maxSize; i = i + chunkSize {
if i > len(records) {
// we went too far and can't longer take slice from records
break
}
wg.Add(1)
size := i + chunkSize
if size > (k + maxSize) {
Expand Down

0 comments on commit fcbb98f

Please sign in to comment.