ASPBoilerplate BackgroundJobs database pooling

255 views Asked by At

I am using ABP framework to develop a web application. By default, the default background job manager pools the database every five seconds to find possible existing defined jobs. According to ABP documents and its implementation I find that it's set to five seconds by default. However, I am not able to update the timer to update this. Even if I tried to disable it using the code below, it was unsuccessful and it is still running.

if (DebugHelper.IsDebug)
{
     Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
}

To continue, is there a way to replace this background job to quartz only. I think in the case of adding Quartz integration, they both run concurrently.

Any help will be appreciated.

enter image description here

1

There are 1 answers

0
Mahyar Mottaghi Zadeh On BEST ANSWER

According to its implementation the default value has been set to five seconds and this can be configured and overridden at the PreInitialize method of the CoreModule. All it needs is below:

public override void PreInitialize()
{
   ...

   BackgroundJobManager.JobPollPeriod = 20000; //20 seconds

   ...        
}