Skip to content

Commit

Permalink
Pass context in.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jul 11, 2024
1 parent 4036e76 commit b0e0507
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kafkalib/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (c Connection) Dialer(ctx context.Context) (*kafka.Dialer, error) {
return dialer, nil
}

func (c Connection) Transport() (*kafka.Transport, error) {
func (c Connection) Transport(ctx context.Context) (*kafka.Transport, error) {
transport := &kafka.Transport{
DialTimeout: 10 * time.Second,
}
Expand All @@ -100,7 +100,7 @@ func (c Connection) Transport() (*kafka.Transport, error) {
transport.TLS = &tls.Config{}
}
case AwsMskIam:
_awsCfg, err := awsCfg.LoadDefaultConfig(context.Background())
_awsCfg, err := awsCfg.LoadDefaultConfig(ctx)
if err != nil {
return nil, fmt.Errorf("failed to load AWS configuration: %w", err)
}
Expand Down

0 comments on commit b0e0507

Please sign in to comment.