Giter VIP home page Giter VIP logo

hangfire.recurringjobadmin's Introduction

Hangfire.RecurringJobAdmin

NuGet Build status Build Status Official Site License MIT

dashboard

A simple dashboard to manage Hangfire's recurring jobs.

This repo is an extension for Hangfire based on "Hangfire.Recurring Job Extensions" package made by vigoss, thanks for your contribution to the community. It contains the following functionalities:

  • We can use RecurringJobAttribute stored in database and presented in the administrator.
public class RecurringJobTesting
{
    [RecurringJob("*/2 * * * *", "China Standard Time", "default", RecurringJobId = "Check-File-Exists")]
    public void CheckFileExists()
    {
       Console.WriteLine("Check File Exists");
    }
}
  • We can use DisableConcurrentlyJobExecution, this attribute allows you to not execute a task if it is already running.
public class RecurringJobTesting
{
    [DisableConcurrentlyJobExecution("CheckFileExists")]
    public void CheckFileExists()
    {
       Console.WriteLine("Check File Exists");
    }
    
    [DisableConcurrentlyJobExecution("ValidateProcess", 0, 10, "It is not allowed to perform multiple same tasks.")]
    [RecurringJob("*/2 * * * *", "China Standard Time", "default", RecurringJobId = "Validate-Process")]
    public void ValidateProcess()
    {
        Console.WriteLine("Validate Process");
    }
}
  • We can create, edit jobs.

create

  • We can start, stop jobs at runtime.

jobAgent

  • So we can also start or stop the job using JobAgent static class.
   JobAgent.StopBackgroundJob("Enter the Job Id");
   
   JobAgent.StartBackgroundJob("Enter the Job Id");
   
   //Get all stopped jobs:
   var StoppedJobs = JobAgent.GetAllJobStopped();
   
  • We have a new vue component to generate cron expression, made by @JossyDevers.

jobAgent

Instructions

Install a package from Nuget.

Install-Package Hangfire.RecurringJobAdmin

Then add this in your code:

For DotNetCore :

for service side:

services.AddHangfire(config => config.UseSqlServerStorage(Configuration.GetConnectionString("HangfireConnection"))
                                                 .UseRecurringJobAdmin(typeof(Startup).Assembly))

For NetFramework :

for startup side:

GlobalConfiguration.Configuration.UseSqlServerStorage("HangfireConnection").UseRecurringJobAdmin(typeof(Startup).Assembly)

Credits

  • Braulio Alvarez

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

License

Authored by: Brayan Mota (bamotav)

This project is under MIT license. You can obtain the license copy here.

hangfire.recurringjobadmin's People

Contributors

bamotav avatar braulioalvarez avatar cocoon avatar dependabot[bot] avatar jadhielv avatar jossydevers avatar vipasane avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.