Tim Deschryver 5/3/2023

Prevent a Hangfire job from running when it is already active

Read Original

This technical blog post explains a solution for preventing concurrent execution of recurring jobs in Hangfire, a .NET background processing library. It details the use case where a job running on a frequent CRON schedule (e.g., every minute) might exceed its allotted time, causing overlapping executions. The article provides a code example demonstrating how to apply the `[DisableConcurrentExecution]` attribute to a job method to queue subsequent runs until the active job finishes.

Prevent a Hangfire job from running when it is already active

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser