.NET Core Hangfire任务计划( 二 )


.NET Core Hangfire任务计划

文章插图
 
Hangfire面板修改
.NET Core Hangfire任务计划

文章插图
 
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {if (env.IsDevelopment()){app.UseDeveloperExceptionPage();}app.UseRouting();app.UseEndpoints(endpoints =>{endpoints.MapHangfireDashboard(new DashboardOptions
{
Authorization = new[] { new MyAuthorizationFilter() }
});
endpoints.MapGet("/", async context =>{await context.Response.WriteAsync("Hello World!");});});BackgroundJob.Enqueue(() => Console.WriteLine("测试"));}
.NET Core Hangfire任务计划

文章插图
 
运行程序
.NET Core Hangfire任务计划

文章插图
 

.NET Core Hangfire任务计划

文章插图
 
文档链接:https://docs.hangfire.io/en/latest/getting-started/index.html



推荐阅读