diff --git a/changelog.md b/changelog.md index 08d92ed9..558825f3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Change Log +## `v1.3.1` +- cleanup connection after making management request + ## `v1.3.0` - add `SystemProperties` to `Event` which contains immutable broker provided metadata (squence number, offset, enqueued time) diff --git a/hub.go b/hub.go index 75b33e8a..67997212 100644 --- a/hub.go +++ b/hub.go @@ -493,6 +493,12 @@ func (h *Hub) GetRuntimeInformation(ctx context.Context) (*HubRuntimeInformation return nil, err } + defer func() { + if err := c.Close(); err != nil { + log.For(ctx).Error(err) + } + }() + info, err := client.GetHubRuntimeInformation(ctx, c) if err != nil { log.For(ctx).Error(err) @@ -509,9 +515,16 @@ func (h *Hub) GetPartitionInformation(ctx context.Context, partitionID string) ( client := newClient(h.namespace, h.name) c, err := h.namespace.newConnection() if err != nil { + log.For(ctx).Error(err) return nil, err } + defer func() { + if err := c.Close(); err != nil { + log.For(ctx).Error(err) + } + }() + info, err := client.GetHubPartitionRuntimeInformation(ctx, c, partitionID) if err != nil { return nil, err diff --git a/version.go b/version.go index 13c3fd12..fa01adf5 100644 --- a/version.go +++ b/version.go @@ -2,5 +2,5 @@ package eventhub const ( // Version is the semantic version number - Version = "1.3.0" + Version = "1.3.1" )