We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1edf9b2 commit 22becd6Copy full SHA for 22becd6
batch.go
@@ -69,6 +69,11 @@ func (b *Batch) Push(record interface{}) error {
69
return errors.New("batch not initialized")
70
}
71
72
+ // if only one item is in the batch, don't even bother storing it
73
+ if b.batchSize == 1 {
74
+ return b.pushHandler([]interface{}{record})
75
+ }
76
+
77
// lock around batch processing
78
b.mutex.Lock()
79
@@ -94,7 +99,6 @@ func (b *Batch) Push(record interface{}) error {
94
99
return err
95
100
96
101
97
- // dereference batch to clue GC, unless user wants to retain data
98
102
batch = nil
103
} else {
104
0 commit comments