Skip to content

Commit

Permalink
notifier: correctly close channels after amqp delivery
Browse files Browse the repository at this point in the history
this commit correctly closes the amqp channel after usage.

Signed-off-by: ldelossa <ldelossa@redhat.com>
  • Loading branch information
ldelossa authored and ldelossa committed Aug 24, 2020
1 parent 4d69438 commit 717f8a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions notifier/amqp/deliverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (d *Deliverer) Deliver(ctx context.Context, nID uuid.UUID) error {
if err != nil {
return &clairerror.ErrDeliveryFailed{err}
}
defer ch.Close()

callback := d.conf.callback
callback.Path = path.Join(callback.Path, nID.String())
Expand Down
2 changes: 2 additions & 0 deletions notifier/amqp/directdeliverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ func (d *DirectDeliverer) Deliver(ctx context.Context, _ uuid.UUID) error {
if err != nil {
return &clairerror.ErrDeliveryFailed{err}
}
defer ch.Close()

err = ch.Tx()
if err != nil {
return &clairerror.ErrDeliveryFailed{err}
Expand Down

0 comments on commit 717f8a0

Please sign in to comment.