Skip to content

Instantly share code, notes, and snippets.

View replyarifhussain's full-sized avatar

Arif Hussain replyarifhussain

  • Dubai,UAE
View GitHub Profile
@arxae
arxae / SkipWhenPreviousJobIsRunningAttribute.cs
Created January 10, 2019 00:17
Apply to class that executes a job in Hangfire. If a recurring job with this attribute is already running, a new one won't start
using System;
using System.Collections.Generic;
using Hangfire.Client;
using Hangfire.Common;
using Hangfire.States;
using Hangfire.Storage;
/// <summary>
/// Makes sure that 2 (or more) same jobs will not be run twice at the same time.