Skip to content

Commit

Permalink
Prevent sending data to closed lease channel
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinfish committed Sep 5, 2019
1 parent e1a121a commit 7dd2941
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Log

## `head`
- fix send on closed channel for GetLeases

## `v2.0.2`
- enable partitionKey for sendBatch to fix [#128](https://github.com/Azure/azure-event-hubs-go/issues/128)
Expand Down
2 changes: 2 additions & 0 deletions storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ func (sl *LeaserCheckpointer) GetLeases(ctx context.Context) ([]eph.LeaseMarker,
partitionIDs := sl.processor.GetPartitionIDs()
leaseCh := make(chan leaseGetResult)
defer close(leaseCh)
ctx, cancel := context.WithCancel(ctx)
defer cancel()

for _, partitionID := range partitionIDs {
go func(pID string) {
Expand Down

0 comments on commit 7dd2941

Please sign in to comment.