From 4eb2b9d5d4f43484f7a029dce7dca57ead66b486 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Thu, 26 Oct 2023 10:48:07 -0400 Subject: [PATCH] Replace deprecated Publish method with PublishWithContext --- engine/pstr_amqp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/pstr_amqp.go b/engine/pstr_amqp.go index 3d64d00e8..b2b012111 100644 --- a/engine/pstr_amqp.go +++ b/engine/pstr_amqp.go @@ -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