From d870e1463adbd4feaf717203ac2f1e043573bf1f Mon Sep 17 00:00:00 2001 From: steden <1470804@qq.com> Date: Mon, 15 Jul 2024 13:47:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9AasyncLocal=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=87=8A=E6=94=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rabbitConsumer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rabbitConsumer.go b/rabbitConsumer.go index d7e17d7..e789dc1 100644 --- a/rabbitConsumer.go +++ b/rabbitConsumer.go @@ -56,7 +56,7 @@ func (receiver *rabbitConsumer) Subscribe(queueName string, routingKey string, p } // 读取通道的消息 for page := range deliveries { - asyncLocal.GC() + asyncLocal.Release() entryMqConsumer := receiver.manager.traceManager.EntryMqConsumer(page.CorrelationId, page.AppId, receiver.manager.config.Server, queueName, receiver.manager.config.RoutingKey) args := receiver.createEventArgs(page, queueName) exception.Try(func() { @@ -88,7 +88,7 @@ func (receiver *rabbitConsumer) SubscribeAck(queueName string, routingKey string } // 读取通道的消息 for page := range deliveries { - asyncLocal.GC() + asyncLocal.Release() entryMqConsumer := receiver.manager.traceManager.EntryMqConsumer(page.CorrelationId, page.AppId, receiver.manager.config.Server, queueName, receiver.manager.config.RoutingKey) args := receiver.createEventArgs(page, queueName) isSuccess := false @@ -131,7 +131,7 @@ func (receiver *rabbitConsumer) SubscribeBatch(queueName string, routingKey stri go func() { var chl *amqp.Channel for { - asyncLocal.GC() + asyncLocal.Release() time.Sleep(500 * time.Millisecond) // 创建一个连接和通道 var err error @@ -172,7 +172,7 @@ func (receiver *rabbitConsumer) SubscribeBatchAck(queueName string, routingKey s go func() { var chl *amqp.Channel for { - asyncLocal.GC() + asyncLocal.Release() time.Sleep(100 * time.Millisecond) // 创建一个连接和通道 var err error