From 14bfc99871f6107b18ed4353c4546e0453ae4228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Thu, 28 Dec 2023 11:44:21 +0100 Subject: [PATCH] fix: catalog upload loop on big catalogs. --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 30b05ad..ae56a97 100644 --- a/main.go +++ b/main.go @@ -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]...) @@ -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 + } } }