Hangfire icon indicating copy to clipboard operation
Hangfire copied to clipboard

Hangfire auto clean up?

Open jwilburn opened this issue 3 years ago • 2 comments

Does Hangfire have any functionality to reset its tables and or clean them up? Hangfire.State can grow very large in size over time. I would like to avoid having to write separate code to handle this.

Here is a stackoverflow article describing a similar situation. https://stackoverflow.com/questions/39973447/how-can-i-safely-reset-hangfire-to-a-clean-state

jwilburn avatar May 03 '22 14:05 jwilburn

Sometimes it depends on the storage implementation, and problems with job storage implementation might cause this problem to happen. Could you tell me what storage you are using? Also, it's expected that background job will be finished eventually, and not be retried over and over again, and this behavior might cause Hangfire.State table to grow infinitely.

odinserj avatar May 04 '22 08:05 odinserj

I changed my jobs to create a new one instead of requeuing the old one, but it's bad to handle the continuation of a job, if there was a way to make the new job connected to the old one would be easier to control.

in the other hand I have problems with extensions that doesn't clean their data after the job is done

#2028

#1976

luizfbicalho avatar Jun 07 '22 23:06 luizfbicalho