Delete failed jobs iwth more than 1 day

How can i delete failed jobs with more than 1 day?

the code i made in VB Net is .
Idx = 0
For Each Job In HangFireMonitor.FailedJobs(0, CInt(HangFireMonitor.FailedCount()))
Idx = Idx + 1

            Console.WriteLine("Idx:" & Idx.ToString & "-Failed Job ID: " & Job.Key)
            ' BackgroundJob.Delete(job.key)
        Next

Now i want to delete all the jobs that failed with more than 1 day.
I have tried to find it but with no sucess.

Thks

doismm

failed with more than 1 day

You mean failed more than one day ago?

Why are you even letting the failed jobs go into the failed bucket at all? You can set failed jobs to be deleted after failing reties.

[Queue("default")]
[AutomaticRetry(Attempts = 5, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
public void BackgroundMethod()
{
    ...
}

See: Dealing with Exceptions — Hangfire Documentation