Hangfire - Prevent multiples of the same job being enqueued
问题 Scenario: Job 1 is scheduled to run every 5 minutes, and takes ~1 minute to complete. A lot of work piles up and Job 1 takes 15 minutes to run. There are now three Job 1's being processed concurrently - I don't want this. How do I prevent Job 1 being added to the queue again if it is already there? Is there Hangfire setting, or do I need to poll job statuses manually? 回答1: You can use DisableConcurrentExecution attribute to prevent multiple executions of a method concurrently. Just put this