fixed last chunk

This commit is contained in:
ston1th 2022-08-21 21:47:35 +02:00
commit 4f043d228d

View file

@ -199,6 +199,9 @@ func (f *file) WriteAt(data []byte, pos int64) (n int, err error) {
w, e := c.writeAt(data[n:], woff) w, e := c.writeAt(data[n:], woff)
n += w n += w
if c.full() { if c.full() {
if f.w.last.cn == cn {
f.w.last = nil
}
// async flush // async flush
go func() { go func() {
c.flush(notLastChunk) c.flush(notLastChunk)