refactor: 重命名内置后台任务注入方法名称

This commit is contained in:
Argo Zhang 2019-09-03 23:38:15 +08:00
parent 40d3aa3e97
commit bf51dca5d0
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 7 additions and 6 deletions

View File

@ -63,7 +63,7 @@ namespace Bootstrap.Admin
services.AddBootstrapAdminAuthentication();
services.AddSwagger();
services.AddButtonAuthorization(MenuHelper.RetrieveAllMenus);
services.AddDemoTask();
services.AddBootstrapAdminBackgroundTask();
services.AddHttpClient<GiteeHttpClient>();
services.AddAdminHealthChecks();
services.AddMvc(options =>

View File

@ -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
/// 添加示例后台任务
/// </summary>
/// <param name="services"></param>
public static IServiceCollection AddDemoTask(this IServiceCollection services)
public static IServiceCollection AddBootstrapAdminBackgroundTask(this IServiceCollection services)
{
services.AddHostedService<TaskBackgroundServices>();
return services.AddTaskServices();
services.AddTaskServices();
services.AddHostedService<BootstrapAdminBackgroundServices>();
return services;
}
}
/// <summary>
/// 后台任务服务类
/// </summary>
internal class TaskBackgroundServices : BackgroundService
internal class BootstrapAdminBackgroundServices : BackgroundService
{
/// <summary>
/// 运行任务