Hi ABP team,
I have a question regarding HangfirePeriodicBackgroundWorkerAdapter. I understand this is a worker which is asking as a bridge. What I don't find so nice about this approach is that it's flooding the hangfire dashboard, and if somebody wants to check jobs of the application it's difficult to find them.
If someone would use directly HangfireBackgroundWorkerBase , would HangfirePeriodicBackgroundWorkerAdapter actually be necessary? And if no, can it be disabled?
8 Answer(s)
-
0
If you use HangfireBackgroundWorkerBase directly, you do not need the HangfirePeriodicBackgroundWorkerAdapter. The adapter is only necessary when you want to run ABP's IBackgroundWorker implementations (such as AsyncPeriodicBackgroundWorkerBase) on Hangfire, bridging ABP's background worker system to Hangfire's infrastructure.
When you implement your workers by inheriting from HangfireBackgroundWorkerBase, you are using Hangfire's native recurring job mechanism, and jobs will appear in the dashboard as you define them, without the adapter's extra entries.
To avoid flooding the Hangfire dashboard with HangfirePeriodicBackgroundWorkerAdapter jobs, you can disable or remove the registration of ABP's background workers that use the adapter, and instead implement your recurring jobs directly using HangfireBackgroundWorkerBase.
In summary: HangfirePeriodicBackgroundWorkerAdapter is not required if you use HangfireBackgroundWorkerBase. You can disable the adapter by not registering ABP background workers that rely on it.
Sources:
- https://abp.io/docs/latest/framework/infrastructure/background-workers/hangfire
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
hi
You can set the job name after 9.3.0
https://github.com/abpframework/abp/issues/22700 https://github.com/abpframework/abp/pull/22714
Thanks.
-
0
Hi Maliming,
I don't want to set a new name, I want to get rid of HangfirePeriodicBackgroundWorkerAdapter from the hangfire dashboard because it's generating a flood of executed jobs, which eat up the ones that we care about.
Is it actually necessary to run HangfirePeriodicBackgroundWorkerAdapter if we use only HangfireBackgroundWorkerBase
-
0
Alex, this might help?:
https://github.com/face-it/Hangfire.Tags
-
0
Hi Frontis,
Thanks for doing the research. The repository seems out of date and I wouldn't base a solution on this.
-
0
hi
ABP hangfire module will use
HangfirePeriodicBackgroundWorkerAdapter
to execute your/modulesPeriodicBackgroundWorkers
.Maybe we can remove
HangfirePeriodicBackgroundWorkerAdapter
and execute the worker directly. I will check this.However, all workers are still listed in the Hangfire dashboard.
Thanks.
-
0
Yeah, it's clear that we are going to see internal abp workers, but right now I think that Activate<HangfirePeriodicBackgroundWorkerAdapter<BackgroundJobWorker>>() is not doing anything, since we don't have internally any PeriodicBackgroundWorkers , we always use HangfirePeriodicBackgroundWorkerAdapter
-
0
hi
The built-in modules(
OpenIddict, Identity.Pro...
) will have somePeriodicBackgroundWorkers
.