How do I delete/clear all my jobs in Hangfire?

Smith
Smith
2890 Points
78 Posts

I'm using Hangfire job in my .net application. It seems lot of data as logs. How do I clear all my jobbs.

Views: 4508
Total Answered: 1
Total Marked As Answer: 0
Posted On: 27-Nov-2022 05:06

Share:   fb twitter linkedin
Answers
Rashmi
Rashmi
1068 Points
19 Posts
         

Execute following queries:

TRUNCATE TABLE [HangFire].[AggregatedCounter]
TRUNCATE TABLE [HangFire].[Counter]
TRUNCATE TABLE [HangFire].[JobParameter]
TRUNCATE TABLE [HangFire].[JobQueue]
TRUNCATE TABLE [HangFire].[List]
TRUNCATE TABLE [HangFire].[State]
DELETE FROM [HangFire].[Job]
DBCC CHECKIDENT ('[HangFire].[Job]', reseed, 0)
UPDATE [HangFire].[Hash] SET Value = 1 WHERE Field = 'LastJobId'
Posted On: 27-Nov-2022 06:22
 Log In to Chat