Patch a tricky bug in parsing of json header and save the last sequence from files

Former-commit-id: bfe3d0e9eb8e65113699d535bd1d9a5fe0d3ce1d
This commit is contained in:
Eric Coissac
2024-06-04 13:46:23 +02:00
parent aa42df326a
commit e843d2aa5c
4 changed files with 36 additions and 8 deletions

View File

@ -106,6 +106,16 @@ func ReadSeqFileChunk(reader io.Reader,
}
}
if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF {
log.Fatalf("Error reading data from file : %s", err)
}
// Send the last chunk to the channel
if len(buff) > 0 {
io := bytes.NewBuffer(slices.Clone(buff))
chunk_channel <- SeqFileChunk{io, i}
}
// Close the readers channel when the end of the file is reached
close(chunk_channel)
}()