打开 关闭

How to add CRON in Background jobs #7223


User avatar
0
Yaduraj.Shakti 创建

We want to send a monthly report to end users from our application (microservice) and want to use background Jobs. Please can you share how to set a CRON or schedule without using Hangfire or any other library.

Also suggest if there are other ways for this use-case. Thanks

https://docs.abp.io/en/abp/latest/Background-Jobs

  • ABP Framework version: v7.2.2
  • UI Type: Angularr
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:

3 答案
  • User Avatar
    0
    maliming 创建
    支持团队 Fullstack Developer

    hi

    The background job manager doesn't support CRON by default. It's just a simple job manager. for advanced features, you have to use a third-party library.

    https://docs.abp.io/en/abp/latest/Background-Jobs#default-background-job-manager

  • User Avatar
    0
    Yaduraj.Shakti 创建

    Hi @maliming

    Thank you for your response.

    in this case how can I schedule Background job to run on monthly basis on a specific time such as EOD (I am bound to not use hangfire or any other lib as of now). Please can you come up with an example?

    Thanks!

  • User Avatar
    0
    maliming 创建
    支持团队 Fullstack Developer

    hi

    how can I schedule Background job to run on monthly basis on a specific time such as EOD

    You should use Background-Workers in your case.

    https://docs.abp.io/en/abp/latest/Background-Workers#asyncperiodicbackgroundworkerbase

Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11