Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Disable background jobs #8166


User avatar
0
sumitshah created

Hi,

We need to completely disable the background jobs in our project. we have tried :

Configuration.BackgroundJobs.IsJobExecutionEnabled = false;

in the WebCoreModule.cs, Core Project >> CoreModule.cs but checking the queries in the SQL profiler, the below query is getting fired almost every 2 seconds

exec sp_executesql N'SELECT TOP(@__p_1) [t].[Id], [t].[CreationTime], [t].[CreatorUserId], [t].[IsAbandoned], [t].[JobArgs], [t].[JobType], [t].[LastTryTime], [t].[NextTryTime], [t].[Priority], [t].[TryCount]
FROM [AbpBackgroundJobs] AS [t]
WHERE ([t].[IsAbandoned] = 0) AND ([t].[NextTryTime] <= @__Now_0)
ORDER BY [t].[Priority] DESC, [t].[TryCount], [t].[NextTryTime]',N'@__p_1 int,@__Now_0 datetime2(7)',@__p_1=1000,@__Now_0='2019-12-09 16:21:02.3694549'

could you please let us know how to completely stop these background jobs.


2 Answer(s)
  • User Avatar
    0
    musa.demir created

    Did you override IBackgroundJobStore? Because it should be replaced with NullBackgroundJobStore If IsJobExecutionEnabled=false

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/c33224544a18b00512162a489bc55c3ca194431f/src/Abp/AbpKernelModule.cs#L216-L223

  • User Avatar
    0
    sumitshah created

    Thank you, we were able to successfully disable the job