From aad8e086a11ff282562e212901563a65a049db6e Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Tue, 29 Jul 2025 23:20:10 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9C=8D=E5=8A=A1=E5=95=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9C=AA=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InterfaceForwardApplicationModule.cs | 3 +++ .../Rabbit/BatchForwardEventHandler.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs b/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs index 14f0345..1b135da 100644 --- a/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs +++ b/src/InterfaceForward.Application/InterfaceForwardApplicationModule.cs @@ -7,6 +7,7 @@ using Fake.RabbitMQ; using FreeRedis; using InterfaceForward.Application.Contracts; using InterfaceForward.Application.Helpers; +using InterfaceForward.Application.HostServices; using InterfaceForward.Domain.Shared; using InterfaceForward.Repositories; using Microsoft.Extensions.Configuration; @@ -32,6 +33,8 @@ public class InterfaceForwardApplicationModule:FakeModule }); context.Services.Configure(configuration.GetSection("InterfaceRelay")); + + context.Services.AddHostedService(); var options = configuration.GetSection("Redis").Get(); if (options == null) diff --git a/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs b/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs index 18feae4..1116208 100644 --- a/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs +++ b/src/InterfaceForward.Application/Rabbit/BatchForwardEventHandler.cs @@ -10,6 +10,7 @@ using RabbitMQ.Client.Events; namespace InterfaceForward.Application.Rabbit; +[ExposeServices(typeof(IRabbitHandler))] public class BatchForwardEventHandler( InterfaceForwardCommon forwardCommon, RabbitClient rabbitClient,