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

Some information about Background jobs #1749


User avatar
0
diego created

Hi all, i have some issue and questions about background jobs.

First of all my version of Abp framework is 0.9.1.1, i use it with asp.net zero version 1.10.1

Questions:

  • There is a way to schedule a single execution for a job on default background job manager? I don't want the manager retry execution on fail. The job success or fail, no retry
  • On default background job manager what is the maximum try count? I don't want to wait 2 days for timeout
  • My website is hosted on azure web site, currently run on 2 instances. Concurrency for jobs work fine in this scenario?
  • In multi-instance scenario, is possible to know what instance has performed the job?

Issue:

  • My job fail reporting this error: Timeout expired. I have a UnitOfWork with 30 minutes timeout , the job fail after 1 minute or less. Any suggestion? I think this is a bug After deep testing i see that first exection of the job fail, usually the second work fine. I think is related to the environment (2 instance on azure) but i'm not sure
  • The job execution history are saved to database?

Thanks in advance, Diego


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team
    • Write your code in try-catch and hide exceptions. Background job manager only retries on exceptions.
    • no max try count. it's controlled by time. You can set BackgroundJobInfo.DefaultTimeout static value to a lower value.
    • You should disable background job execution for one of the servers. see <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers#disabling-job-execution">http://www.aspnetboilerplate.com/Pages/ ... -execution</a>
    • No way, because ABP does not know your instances. But you can know it while executing your job (for example, write the instance name in web.config and read it in job execution)

    issues

    • Probably this is because of connection establishment duration or something related to your environment. I can not have a suggestion unless know more.
    • Default job manager does not save it. Only saves it on background jobs table columns (like try count, last try date etc.)

    Also, you can switch to hangfire for a detailed job manager. ABP's implementation is simpler.