Skip to content

Commit 048e4ea

Browse files
authored
[chore][pkg/stanza/fileconsumer] Use caller context in poll checkpoint save (#47333)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Replace `context.Background()` with the available `ctx` so the checkpoint save participates in graceful shutdown. Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
1 parent e784e1a commit 048e4ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/stanza/fileconsumer/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (m *Manager) poll(ctx context.Context) {
152152
if m.persister != nil {
153153
metadata := m.tracker.GetMetadata()
154154
if metadata != nil {
155-
if err := checkpoint.Save(context.Background(), m.persister, metadata); err != nil {
155+
if err := checkpoint.Save(ctx, m.persister, metadata); err != nil {
156156
m.set.Logger.Error("save offsets", zap.Error(err))
157157
}
158158
}

0 commit comments

Comments
 (0)