mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Replace deprecated Publish method with PublishWithContext
This commit is contained in:
committed by
Dan Christian Bogos
parent
6d20afc8c5
commit
4eb2b9d5d4
@@ -25,6 +25,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/birpc/context"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
amqp "github.com/rabbitmq/amqp091-go"
|
||||
)
|
||||
@@ -105,7 +106,8 @@ func (pstr *AMQPPoster) Post(content []byte, _ string) (err error) {
|
||||
return
|
||||
}
|
||||
for i := 0; i < pstr.attempts; i++ {
|
||||
if err = chn.Publish(
|
||||
if err = chn.PublishWithContext(
|
||||
context.TODO(),
|
||||
pstr.exchange, // exchange
|
||||
pstr.routingKey, // routing key
|
||||
false, // mandatory
|
||||
|
||||
Reference in New Issue
Block a user