My succeeded job queue is at almost 5 million. I set the JobExpirationTimeout to 4 days but I still have jobs from almost a year ago which are not being removed.
First of all, retention, or expiration time is setting up only for successful and deleted jobs. Other job states, including the failed state, don't have any expiration time. That is why your failed jobs will be kept infinitely before you fix/retry or delete them manually.
But if you really want to set up retention time for succeeded or deleted jobs, you can add the following job filter (they are like action filters in ASP.NET MVC):
public class ProlongExpirationTimeAttribute : JobFilterAttr…
Is there some other property I should be looking at? The Deleted queue is being cleared out properly.
What is the best way to immediately remove the succeeded jobs? Can I just delete from the job table where the statename = ‘Succeeded’?
I am running the latest version of hang fire.
I’m having the same issue. My succeeded job queue is at 5 million. Why isn’t it clearing out? There is nothing I’ve done to customize this that I’m aware of. I’m using the Hangfire Pro with Redis.
Are these the numbers in the dashboard you are referring to? The numbers in the dashboard are just a counter value in the database, it doesn’t necessarily mean the data for the job is still in the database.