summaryrefslogtreecommitdiff
path: root/plugins/amqp/amqpjobs/redial.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-02 20:09:01 +0300
committerGitHub <[email protected]>2021-09-02 20:09:01 +0300
commit6749db4a2d39fa70b426bcf50edf66a176c07f57 (patch)
treef6f92c9f0016f6bcac6a9aa45ccc961eebf90018 /plugins/amqp/amqpjobs/redial.go
parent0437d1f58514f694ea86e8176e621c009cd510f9 (diff)
parent4524f8c5af045ed5048250b63b7859eaeb4f24a1 (diff)
#778: feat(refactor): jobs code adjustingv2.4.0
#778: feat(refactor): jobs code adjusting
Diffstat (limited to 'plugins/amqp/amqpjobs/redial.go')
-rw-r--r--plugins/amqp/amqpjobs/redial.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/plugins/amqp/amqpjobs/redial.go b/plugins/amqp/amqpjobs/redial.go
index 8d21784f..698a34a6 100644
--- a/plugins/amqp/amqpjobs/redial.go
+++ b/plugins/amqp/amqpjobs/redial.go
@@ -113,25 +113,22 @@ func (c *consumer) redialer() { //nolint:gocognit
c.Unlock()
case <-c.stopCh:
- if c.publishChan != nil {
- pch := <-c.publishChan
- err := pch.Close()
- if err != nil {
- c.log.Error("publish channel close", "error", err)
- }
+ pch := <-c.publishChan
+ err := pch.Close()
+ if err != nil {
+ c.log.Error("publish channel close", "error", err)
}
if c.consumeChan != nil {
- err := c.consumeChan.Close()
+ err = c.consumeChan.Close()
if err != nil {
c.log.Error("consume channel close", "error", err)
}
}
- if c.conn != nil {
- err := c.conn.Close()
- if err != nil {
- c.log.Error("amqp connection close", "error", err)
- }
+
+ err = c.conn.Close()
+ if err != nil {
+ c.log.Error("amqp connection close", "error", err)
}
return