Open Closed

How to add CRON in Background jobs #7223


User avatar
0
Yaduraj.Shakti created

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 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team 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 created

    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 created
    Support Team 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 v9.1.0-preview. Updated on November 01, 2024, 05:35