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) {
177177 defer sp .Finish ()
178178
179179 entries := p .entries .reset ()
180+ if len (entries ) == 0 {
181+ return nil , nil
182+ }
180183
181184 entriesByStream := make (map [string ][]logproto.Entry )
182185 for _ , e := range entries {
@@ -219,6 +222,10 @@ func (p *Push) buildPayload(ctx context.Context) ([]byte, error) {
219222 }
220223 }
221224
225+ if len (streams ) == 0 {
226+ return nil , nil
227+ }
228+
222229 req := & logproto.PushRequest {
223230 Streams : streams ,
224231 }
@@ -268,6 +275,10 @@ func (p *Push) run(pushPeriod time.Duration) {
268275 continue
269276 }
270277
278+ if len (payload ) == 0 {
279+ continue
280+ }
281+
271282 // We will use a timeout within each attempt to send
272283 backoff := backoff .New (context .Background (), * p .backoff )
273284
You can’t perform that action at this time.
0 commit comments