Chaunce.Hangfire is a free, open source,Chaunce.Hangfire.Extension and Chaunce.Hangfire.Client built on the .NETStandard platform. Chaunce.Hangfire.Extension fork from Hangfire.HttpJob!
Please visit our website at http://www.cnblogs.com/xiaoliangge/ for the most current information about this project.
Chaunce.Hangfire is free,open source. Chaunce.Hangfire can be called by Java and go. Now only provide C# sdk.
Chaunce.Hangfire.Cient is available as a NuGet package. You can install it using the NuGet Package Console window:
PM> Install-Package Chaunce.Hangfire.Client -Version 1.0.0
"HangfireClientOptions": {
"RecurringJobUrl": "hangfire/httpjob?op=recurringjob",
"BackgroundJobUrl": "",
"BaseUrl": "http://localhost:5000"
}
public void ConfigureServices(IServiceCollection services)
{
var option = Configuration.GetSection(nameof(HangfireClientOptions)).Get<HangfireClientOptions>();
services.AddHangfireClient(option);
}
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
private readonly IHangfireClient _hangfireClient;
public ValuesController(IHangfireClient hangfireClient)
{
_hangfireClient = hangfireClient;
}
// GET api/values
[HttpGet]
public async Task<ActionResult<IEnumerable<string>>> Get()
{
var result = await _hangfireClient.SendTimerJobAsync(new HttpJobItem
{
Corn = Cron.MinuteInterval(10),
Url = "https://blog.csdn.net/u014401141/article/details/71086757",
JobName = "ζζ―ε€ι¨δ»»ε‘",
}, TaskType.Recurringjob);
return new string[] { "ζζεδΊε", $"{result}" };
}
}
First create database,databse name according to the appsettings.json's ConnectionStrings string there is chauncehangfire
"ConnectionStrings": {
"HangfireConnection": "server=.;database=chauncehangfire;uid=sa;pwd=111111"
},