Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

buffer len should not always reset to 0. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkg/batch/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"
)


// Writer allows to buffer some items and call the Handler function either when the buffer is full or the timeout is
// reached. There will also be support for concurrency for high volume. The handler function is supposed to return an
// array of booleans to indicate whether the transfer was successful or not. It can be replaced with status codes in
Expand Down Expand Up @@ -56,7 +55,6 @@ func (w *Writer) Start() {
case item := <-w.items:
if w.len >= w.cfg.BatchSize {
w.processBuffer(context.Background())
w.len = 0
}

w.buffer[w.len] = bufferItem{v: item, attempt: 0}
Expand Down