Nevets82 / Hangfire.Extensions.Configuration

Functionality to read Hangfire configurations from key-value pair based configuration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hangfire.Extensions.Configuration

Functionality to read Hangfire configurations from key-value pair based configuration.

Install

PM> Install-Package Hangfire.Extensions.Configuration -Version 1.0.0

Functionality

  • GetHangfireDashboardOptions: Gets the Hangfire dashboard options.
  • GetHangfireBackgroundJobServerOptions: Gets the Hangfire background job server options.

Usage

  1. Add this NuGet package to your project.
  2. In your appsettings.json add the following section:
    "Hangfire": {
    	"Dashboard": {
    		"AppPath": "/",
    		"StatsPollingInterval": 2000
    	},
    	"Server": {
    		"HeartbeatInterval": "00:00:30",
    		"Queues": [ "default" ],
    		"SchedulePollingInterval": "00:00:15",
    		"ServerCheckInterval": "00:05:00",
    		"ServerName": null,
    		"ServerTimeout": "00:05:00",
    		"ShutdownTimeout": "00:00:15",
    		"WorkerCount": 20
    	}
    }
  3. In your startup.cs add the following using statement:
    using Hangfire.Extensions.Configuration;
  4. In your startup.cs add the following lines in the configure method:
    app.UseHangfireDashboard("/hangfire", Configuration.GetHangfireDashboardOptions());
    app.UseHangfireServer(Configuration.GetHangfireBackgroundJobServerOptions());

Change Log

Version 1.0.0

New Features

References

About

Functionality to read Hangfire configurations from key-value pair based configuration.

License:MIT License


Languages

Language:C# 100.0%