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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Xunet.Hangfire
Timing scheduling library based on hangfire for .NET
Support .NET 6.0/7.0/8.0
��װ
ʹ��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 | Versions 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.
-
net6.0
- Cronos (>= 0.8.4)
- Dapper (>= 2.1.35)
- JetBrains.Annotations (>= 2023.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- MoreLinq.Source.MoreEnumerable.Pairwise (>= 1.0.2)
- MySqlConnector (>= 2.3.7)
- Newtonsoft.Json (>= 13.0.3)
- StackTraceFormatter.Source (>= 1.1.0)
- StackTraceParser.Source (>= 1.3.1)
-
net7.0
- Cronos (>= 0.8.4)
- Dapper (>= 2.1.35)
- JetBrains.Annotations (>= 2023.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- MoreLinq.Source.MoreEnumerable.Pairwise (>= 1.0.2)
- MySqlConnector (>= 2.3.7)
- Newtonsoft.Json (>= 13.0.3)
- StackTraceFormatter.Source (>= 1.1.0)
- StackTraceParser.Source (>= 1.3.1)
-
net8.0
- Cronos (>= 0.8.4)
- Dapper (>= 2.1.35)
- JetBrains.Annotations (>= 2023.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- MoreLinq.Source.MoreEnumerable.Pairwise (>= 1.0.2)
- MySqlConnector (>= 2.3.7)
- Newtonsoft.Json (>= 13.0.3)
- StackTraceFormatter.Source (>= 1.1.0)
- StackTraceParser.Source (>= 1.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.