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
7fd7167aa5
commit
46e39770a1
@@ -145,7 +145,8 @@ func (pstr *AMQPee) ExportEvent(_ *context.Context, content, _ any) (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
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/birpc/context"
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
@@ -91,7 +92,8 @@ func TestAMQPER(t *testing.T) {
|
||||
|
||||
rdr.Serve()
|
||||
randomOriginID := utils.UUIDSha1Prefix()
|
||||
if err = channel.Publish(
|
||||
if err = channel.PublishWithContext(
|
||||
context.Background(),
|
||||
"test-exchange", // publish to an exchange
|
||||
"test-key", // routing to 0 or more queues
|
||||
false, // mandatory
|
||||
|
||||
Reference in New Issue
Block a user