fix:rabbit client lifetime

This commit is contained in:
xiaolipro 2025-07-25 17:42:24 +08:00
parent 75457c7236
commit 74181364ee

View File

@ -1,3 +1,4 @@
using Fake.DependencyInjection;
using Fake.RabbitMQ; using Fake.RabbitMQ;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -9,7 +10,7 @@ namespace InterfaceForward.Application.Rabbit;
public class RabbitClient( public class RabbitClient(
IRabbitMqChannelPool channelPool, IRabbitMqChannelPool channelPool,
IServiceScopeFactory serviceScopeFactory, IServiceScopeFactory serviceScopeFactory,
ILogger<RabbitClient> logger) ILogger<RabbitClient> logger): ISingletonDependency
{ {
public void Subscribe(ConsumeOptions consumeOptions) public void Subscribe(ConsumeOptions consumeOptions)
{ {