Base solution for your next web application
Open Closed

Hangfire In Core + Angular Questions/help #8853


User avatar
0
AuroraBMS created

Hi Guys,

If anyone can assist with the below it would be greatly appreciated.

I have currently activated all the hangfire functions and settings and struggling a bit with getting my head around the process of implementing recurring jobs etc.

The questions I basically have is:

Where should I create the Job execution component in the aspnetcore application side For example this: (The below code comes from the example provided by ANZ - I however dont quite understand how to implement it in the actual project) BackgroundJob.Schedule<GetServersJob>(x => x.ExecuteJob(null, new GetServersParamsInput()), TimeSpan.FromSeconds(10)) I want to check data continiously and update data during the day if something in another database has been updated.

I have the code for checking and also updating in the ANZ database ready but that is a minor to this whole scenario.

Does anyone have an example of a hangfire Job & Args implemented in aspnetzero angular/core? The part where the job gets setup with the say create customers if new data is available and that is check say every hour or so. For this I have looked through a lot of the questions here on the support portal as well as info on the aspboilerplate and various other points but I just can't figure out where and how to actually implement the functional side of hangfire jobs in this.

The data does not update frequently to place a burden on the system and I am trying to avoid creating an integration tool to write and update data externally.

any detailed guidence will be greatly appreciated as these kinds of implementations I am worried I will rather break the application then get it working.

Thanks in advance


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you want to use Hangfire, you can register your job in the PostInitialize method of your Web Module. Here is a similar example but it uses ABP's default background job system.

  • User Avatar
    0
    BobIngham created

    Hi @AuroraBMS - try taking a look at this answer - it may help. Help in understanding time when background job runs!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @bobingham :)

  • User Avatar
    0
    AuroraBMS created

    Hi Ismcagdas & Bobingham,

    Thank you for the assistance.

    If I can make a suggestion regarding the documentation segment. Please add the hangfire links "guide" that Bobingham shared to the Aspnetzero documentation.

    It is the most detailed bit regarding hangfire and since the placement of the files was one of the most confusing components, this one shows in details how to handle hangfire.

    Thanks again!