Open Closed

Hangfire background job worker #8095


User avatar
0
pablo@ccalp.net created
  • ABP Framework version: v8.3.x
  • UI Type: Angular
  • Database System: EF Core (SQL Server)

I just enabled hangfire to process background workers, is there any documentation about what this worker/job is doing? It runs every minute apparently.

HangfirePeriodicBackgroundWorkerAdapter<BackgroundJobWorker>.DoWorkAsync


7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    BackgroundJobWorker is used to execute background jobs

  • User Avatar
    0
    pablo@ccalp.net created

    Could you please provide more information on how it works internally, is it critical for the background jobs functionality? This is something I have not yet deployed into production and my production server runs jobs just fine without that recurring job. I'm just trying to understand this, how does it execute the background jobs?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Yes, it's BackgroundJob system default implementation. https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs

    Use a background worker to execute pending jobs every minute. if you want you can use Hangfire background job integration to replace the default

  • User Avatar
    0
    pablo@ccalp.net created

    I am using Hangfire, look at the screen shot, let me know if my question is not clear so I can rephrase it.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    As I see, you are using Hangire background worker integration, not Hangfire background job integration. they are different.

    if you want to use Hangfire background job integration too , please check this document: https://abp.io/docs/latest/framework/infrastructure/background-jobs/hangfire

    PS, don't forget to remove Volo.Abp.BackgroundJobs package and remove BackgroundJobWorker from the Hangfire dashboard

  • User Avatar
    0
    pablo@ccalp.net created

    I'm using both, jobs and workers, and I'm very confused by your answers, I followed the documentation to enable both and they are working as expected I assume, I just need to know what is the recurring job that runs every minute doing.

    Should I use one or the other or both?

    what do you mean by :

    PS, don't forget to remove Volo.Abp.BackgroundJobs package and remove BackgroundJobWorker from the Hangfire dashboard Why, and how do I remove them.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    PS, don't forget to remove Volo.Abp.BackgroundJobs package and remove BackgroundJobWorker from the Hangfire dashboard Why, and how do I remove them.

    Because you are using the Hangfire integration, you don't need the default implementation anymore.

    You can remove BackgroundJobs module, or you can also not remove it, it does not cause any problems.

    BackgroundJobs module packages:

    • Volo.Abp.BackgroundJobs.Domain
    • Volo.Abp.BackgroundJobs.Domain.Shared
    • Volo.Abp.BackgroundJobs.EntityFrameworkCore

    Remove recurring job

Made with ❤️ on ABP v9.1.0-preview. Updated on October 22, 2024, 09:35