Skip to content

Commit

Permalink
chore(lambda/promtail): nil check for Promtail client
Browse files Browse the repository at this point in the history
Signed-off-by: hainenber <[email protected]>
  • Loading branch information
hainenber committed Oct 12, 2023
1 parent fa11c89 commit 6bbbd84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/lambda-promtail/lambda-promtail/promtail.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ func (b *batch) createPushRequest() (*logproto.PushRequest, int) {
}

func (b *batch) flushBatch(ctx context.Context) error {
err := b.client.sendToPromtail(ctx, b)
if err != nil {
return err
if b.client != nil {
err := b.client.sendToPromtail(ctx, b)
if err != nil {
return err
}
}
b.resetBatch()

Expand Down

0 comments on commit 6bbbd84

Please sign in to comment.