File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,9 @@ func (p *Push) buildPayload(ctx context.Context) ([]byte, error) {
177
177
defer sp .Finish ()
178
178
179
179
entries := p .entries .reset ()
180
+ if len (entries ) == 0 {
181
+ return nil , nil
182
+ }
180
183
181
184
entriesByStream := make (map [string ][]logproto.Entry )
182
185
for _ , e := range entries {
@@ -219,6 +222,10 @@ func (p *Push) buildPayload(ctx context.Context) ([]byte, error) {
219
222
}
220
223
}
221
224
225
+ if len (streams ) == 0 {
226
+ return nil , nil
227
+ }
228
+
222
229
req := & logproto.PushRequest {
223
230
Streams : streams ,
224
231
}
@@ -268,6 +275,10 @@ func (p *Push) run(pushPeriod time.Duration) {
268
275
continue
269
276
}
270
277
278
+ if len (payload ) == 0 {
279
+ continue
280
+ }
281
+
271
282
// We will use a timeout within each attempt to send
272
283
backoff := backoff .New (context .Background (), * p .backoff )
273
284
You can’t perform that action at this time.
0 commit comments