Skip to content

Commit

Permalink
fix: catalog upload loop on big catalogs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jochumdev committed Dec 28, 2023
1 parent 981c004 commit 14bfc99
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func main() {
pcat1Chunk.current_chunk = append(pcat1Chunk.current_chunk, b...)
}

var lastChunkPos uint64
for chunkpos > 0 {
pcat1Chunk.current_chunk = append(pcat1Chunk.current_chunk, b[:chunkpos]...)

Expand All @@ -231,7 +232,14 @@ func main() {
pcat1Chunk.chunkcount += 1

pcat1Chunk.current_chunk = b[chunkpos:]

//lastChunkPos is here so we know when pcat1Chunk.C.Scan loops from beginnning.
lastChunkPos = chunkpos
chunkpos = pcat1Chunk.C.Scan(b[chunkpos:])

if chunkpos < lastChunkPos {
break
}
}
}

Expand Down

0 comments on commit 14bfc99

Please sign in to comment.