खुला हुआ बंद किया हुआ

BackgroundJob Running Multiple Times on Server #2521


User avatar
0
shijo बनाया था

If you're creating a bug/problem report, please include the followings:

  • ABP Framework version: v5.0.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: background job executing multiple times on server, not able to control this job execution.
  • Steps to reproduce the issue: Create a background job. Call/Execute Job.

7 उत्तर (ओं)
  • User Avatar
    0
    enisn बनाया था
    सहायता दल .NET Developer

    Do you use multiple instances of that service?

  • User Avatar
    0
    shijo बनाया था

    Do you use multiple instances of that service?

    Yes, I am using multiple instances of the service, Is there any way to stop running multiple time?

  • User Avatar
    0
    MichelZ बनाया था

    https://github.com/abpframework/abp/issues/10322

  • User Avatar
    0
    shijo बनाया था

    I went through the link shared, I have one question only the below section is enough to solve this issue, or do I need to change anything in my background service level code?

    context.Services.AddSingleton<IDistributedLockProvider>(sp => { var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); });

  • User Avatar
    0
    MichelZ बनाया था

    Yes, according to the GitHub issue this should be enough. (Also make sure you have Redis configured correctly)

    No need to change anything in the background service level code.

  • User Avatar
    0
    shijo बनाया था

    This is not working as expected, even after adding this code application become too slow to process the requests.

  • User Avatar
    0
    liangshiwei बनाया था
    सहायता दल Fullstack Developer

    Hi,

    Can you share a project and I will check it?

    Or you can use Hangfire or Quartz: https://docs.abp.io/en/abp/latest/Background-Jobs#integrations

Made with ❤️ on ABP v8.2.0-preview Updated on मार्च 25, 2024, 15:11