Open Closed

Background job SQL queries #8292

tinytownsoftware created

Hello, I was looking in Azure to see what queries were bottlenecks and I noticed that this query was running too frequently. It ran 35089 queries in the past 24 hours, which is around 24 per minute. I modified the BackgroundJobManager class and set the JobPollPeriod to one hour, but it didn't seem to have an effect. Any ideas?

(@__Now_0 datetime2(7),@__p_1 int)SELECT TOP(@__p_1) [a].[Id], [a].[CreationTime], [a].[CreatorUserId], [a].[IsAbandoned], [a].[JobArgs], [a].[JobType], [a].[LastTryTime], [a].[NextTryTime], [a].[Priority], [a].[TryCount] FROM [AbpBackgroundJobs] AS [a] WHERE ([a].[IsAbandoned] <> CAST(1 AS bit)) AND ([a].[NextTryTime] <= @__Now_0) ORDER BY [a].[Priority] DESC, [a].[TryCount], [a].[NextTryTime]

1 Answer(s)
  • 0
    tinytownsoftware created

    I figured this out on my own. For those who are having the same issue, add this line to AppNameApplicationModule.cs in PreIntialize():

    BackgroundJobManager.JobPollPeriod = 60 * 60 * 1000;