Skip to content

Commit

Permalink
Use background context for background tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdiep committed Nov 27, 2020
1 parent c2dea0a commit 8a2e7b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pubsublite/internal/wire/publisher.go
Expand Up @@ -385,7 +385,9 @@ func NewPublisher(ctx context.Context, settings PublishSettings, region, topicPa

msgRouterFactory := newMessageRouterFactory(rand.New(rand.NewSource(time.Now().UnixNano())))
pubFactory := &singlePartitionPublisherFactory{
ctx: ctx,
// The user-provided context is used for background tasks (e.g. stream
// reconnects).
ctx: context.Background(),
pubClient: pubClient,
settings: settings,
topicPath: topicPath,
Expand Down

0 comments on commit 8a2e7b9

Please sign in to comment.