Skip to content

Commit

Permalink
⚡ refactor: Configure the number of retries for backend jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh425 committed Feb 11, 2025
1 parent b044b70 commit 66e43bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Services/Masa.Alert.Service/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the Apache License. See LICENSE.txt in the project root for license information.

using Masa.BuildingBlocks.Data;

var builder = WebApplication.CreateBuilder(args);

await builder.Services.AddMasaStackConfigAsync(MasaStackProject.Alert, MasaStackApp.Service);
Expand Down Expand Up @@ -97,7 +99,10 @@
});
builder.Services.AddBackgroundJob(options =>
{
options.UseInMemoryDatabase();
options.UseInMemoryDatabase(_ =>
{
_.MaxRetryTimes = 1;
}, serviceProvider => serviceProvider.GetService<IIdGenerator<Guid>>()!);
});

builder.Services
Expand Down

0 comments on commit 66e43bb

Please sign in to comment.