This is expected functionality, and only occurs for completed or deleted jobs, any pending or failed jobs are not removed. If you want more information, you can see the source code here:
https://github.com/HangfireIO/Hangfire/search?utf8=✓&q=JobExpirationTimeout&type=Code
or a conversation with the creator of hangfire on how to adjust the length of the expiration here:
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 : JobFilterAttribu…
later,
Geddy