mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 08:08:45 +05:00
Replace deprecated Publish method with PublishWithContext
This commit is contained in:
committed by
Dan Christian Bogos
parent
c4e0d92a2a
commit
d1d43913c8
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package ees
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
@@ -146,7 +147,8 @@ func (pstr *AMQPee) ExportEvent(content any, _ string) (err error) {
|
||||
pstr.reqs.done()
|
||||
return utils.ErrDisconnected
|
||||
}
|
||||
err = pstr.postChan.Publish(
|
||||
err = pstr.postChan.PublishWithContext(
|
||||
context.TODO(),
|
||||
pstr.exchange, // exchange
|
||||
pstr.routingKey, // routing key
|
||||
false, // mandatory
|
||||
|
||||
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package ers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -93,7 +94,8 @@ func TestAMQPER(t *testing.T) {
|
||||
|
||||
rdr.Serve()
|
||||
randomCGRID := utils.UUIDSha1Prefix()
|
||||
if err = channel.Publish(
|
||||
if err = channel.PublishWithContext(
|
||||
context.TODO(),
|
||||
"test-exchange", // publish to an exchange
|
||||
"test-key", // routing to 0 or more queues
|
||||
false, // mandatory
|
||||
|
||||
Reference in New Issue
Block a user