Xunet.Hangfire 1.8.12.2

dotnet add package Xunet.Hangfire --version 1.8.12.2                
NuGet\Install-Package Xunet.Hangfire -Version 1.8.12.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xunet.Hangfire" Version="1.8.12.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xunet.Hangfire --version 1.8.12.2                
#r "nuget: Xunet.Hangfire, 1.8.12.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xunet.Hangfire as a Cake Addin
#addin nuget:?package=Xunet.Hangfire&version=1.8.12.2

// Install Xunet.Hangfire as a Cake Tool
#tool nuget:?package=Xunet.Hangfire&version=1.8.12.2                

Xunet.Hangfire

Timing scheduling library based on hangfire for .NET

Support .NET 6.0/7.0/8.0

Nuget Downloads License Vistors

��װ

ʹ��NuGet Package ����̨���ڰ�װ����

PM> Install-Package Xunet.Hangfire

ʹ��

Program.cs

var builder = WebApplication.CreateBuilder(args);

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");

if (connectionString == null) throw new ArgumentNullException(nameof(connectionString));

var sqlOptions = new MySqlStorageOptions()
{
    TablesPrefix = "Hangfire_"
};
var storage = new MySqlStorage(connectionString, sqlOptions);

builder.Services.AddHangfire((a, x) =>
{
    x.UseStorage(storage: storage).WithJobExpirationTimeout(timeout: TimeSpan.FromDays(7));
    x.UseConsole();
    x.UseHeartbeatPage(checkInterval: TimeSpan.FromSeconds(2));
    x.UseTagsWithMySql(sqlOptions: sqlOptions);
    x.UseRecurringJobAdmin(Assembly.GetExecutingAssembly());
});

builder.Services.AddHangfireServer(optionsAction: (provider, options) =>
{
    options.WorkerCount = 40;
    options.Queues = ["default"];
}
, storage: storage, additionalProcesses: new[]
{
    new ProcessMonitor(checkInterval: TimeSpan.FromSeconds(2))
});

var app = builder.Build();

app.MapHangfireDashboard(string.Empty, new DashboardOptions
{
    IsReadOnlyFunc = _ => false,
    DashboardTitle = "��ʱ����"
});

app.Run();

appsettings.json

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "Kestrel": {
    "Endpoints": {
      "http": {
        "Url": "http://0.0.0.0:8888"
      }
    }
  },
  "ConnectionStrings": {
    "DefaultConnection": "server=127.0.0.1;uid=root;pwd=root;database=hangfire;Allow User Variables=True;"
  }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.8.12.2 110 6/27/2024
1.8.12.1 108 6/27/2024