diff --git a/src/admin/Bootstrap.Admin/Startup.cs b/src/admin/Bootstrap.Admin/Startup.cs index 3ac421b4..38ecee6d 100644 --- a/src/admin/Bootstrap.Admin/Startup.cs +++ b/src/admin/Bootstrap.Admin/Startup.cs @@ -63,7 +63,7 @@ namespace Bootstrap.Admin services.AddBootstrapAdminAuthentication(); services.AddSwagger(); services.AddButtonAuthorization(MenuHelper.RetrieveAllMenus); - services.AddDemoTask(); + services.AddBootstrapAdminBackgroundTask(); services.AddHttpClient(); services.AddAdminHealthChecks(); services.AddMvc(options => diff --git a/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs b/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs index 0b35919b..0a699f4c 100644 --- a/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs +++ b/src/admin/Bootstrap.Admin/Tasks/TasksExtensions.cs @@ -1,4 +1,4 @@ -using Longbow.Tasks; +using Longbow.Tasks; using Microsoft.Extensions.Hosting; using System; using System.Linq; @@ -16,17 +16,18 @@ namespace Microsoft.Extensions.DependencyInjection /// 添加示例后台任务 /// /// - public static IServiceCollection AddDemoTask(this IServiceCollection services) + public static IServiceCollection AddBootstrapAdminBackgroundTask(this IServiceCollection services) { - services.AddHostedService(); - return services.AddTaskServices(); + services.AddTaskServices(); + services.AddHostedService(); + return services; } } /// /// 后台任务服务类 /// - internal class TaskBackgroundServices : BackgroundService + internal class BootstrapAdminBackgroundServices : BackgroundService { /// /// 运行任务