Skip to content

Commit

Permalink
debug: support pprof1
Browse files Browse the repository at this point in the history
  • Loading branch information
yangkaa committed Oct 28, 2024
1 parent 5a664b2 commit 2417722
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mq/api/grpc/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (s *mqServer) Dequeue(ctx context.Context, in *pb.DequeueRequest) (*pb.Task
if in.Topic == "" || !s.actionMQ.TopicIsExist(in.Topic) {
return nil, fmt.Errorf("topic %s is not support", in.Topic)
}
logrus.Infof("dequeue task (%s) by (%s).", in.Topic, in.ClientHost)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
message, err := s.actionMQ.Dequeue(ctx, in.Topic)
Expand All @@ -86,7 +87,7 @@ func (s *mqServer) Dequeue(ctx context.Context, in *pb.DequeueRequest) (*pb.Task
return &task, nil
}

//RegisterServer 注册服务
// RegisterServer 注册服务
func RegisterServer(server *grpc1.Server, actionMQ mq.ActionMQ) {
pb.RegisterTaskQueueServer(server, &mqServer{actionMQ})
}

0 comments on commit 2417722

Please sign in to comment.