Closed VoidMonk closed 8 years ago
sure, that's totally unrelated to hangifre.redis it's something that you can configure through redis core's filters as explained here: http://discuss.hangfire.io/t/how-to-configure-the-retention-time-of-job/34/7 I use the following class
public class ProlongExpirationTimeAttribute : JobFilterAttribute, IApplyStateFilter
{
TimeSpan _jobExpirationTimeout;
public ProlongExpirationTimeAttribute(TimeSpan jobExpirationTimeout)
{
_jobExpirationTimeout = jobExpirationTimeout;
}
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
context.JobExpirationTimeout = _jobExpirationTimeout;
}
public void OnStateUnapplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
{
}
}
and then, in the startup:
GlobalJobFilters.Filters.Add(
new ProlongExpirationTimeAttribute(mySomeHowRetrievedExpirationTimespan));
HTH
Thanks!
when do the expired jobs disappear all together? If I have a recurring job that occurs every minute, i do not want to see the expired jobs a month from now. I do see SucceededListSize. Now I'm wondering if this limits the size in redis
Successful jobs appear as expired within a day or so, Is there a way to extend the storage time period to keep successful jobs & related data for longer?