Replace deprecated Publish method with PublishWithContext

This commit is contained in:
ionutboangiu
2023-10-26 10:48:07 -04:00
committed by Dan Christian Bogos
parent 6d20afc8c5
commit 4eb2b9d5d4

View File

@@ -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