[FA-misc] Saga seems to work, fixed a UserNovelDataService bug
This commit is contained in:
@@ -2,13 +2,16 @@ using FictionArchive.Common.Extensions;
|
||||
using FictionArchive.Service.NovelService.Consumers;
|
||||
using FictionArchive.Service.NovelService.GraphQL;
|
||||
using FictionArchive.Service.NovelService.Models.Configuration;
|
||||
using FictionArchive.Service.NovelService.Sagas;
|
||||
using FictionArchive.Service.NovelService.Services;
|
||||
using FictionArchive.Service.NovelService.Services.SourceAdapters;
|
||||
using FictionArchive.Service.NovelService.Services.SourceAdapters.Novelpia;
|
||||
using FictionArchive.Service.Shared;
|
||||
using FictionArchive.Service.Shared.Extensions;
|
||||
using FictionArchive.Service.Shared.Services.GraphQL;
|
||||
using MassTransit;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NodaTime;
|
||||
|
||||
namespace FictionArchive.Service.NovelService;
|
||||
|
||||
@@ -33,8 +36,17 @@ public class Program
|
||||
{
|
||||
x.AddConsumer<TranslationRequestCompletedConsumer>();
|
||||
x.AddConsumer<FileUploadRequestStatusUpdateConsumer>();
|
||||
x.AddConsumer<NovelUpdateRequestedConsumer>();
|
||||
x.AddConsumer<ChapterPullRequestedConsumer>();
|
||||
x.AddConsumer<NovelImportRequestedConsumer>();
|
||||
x.AddConsumer<NovelImportCompletedConsumer>();
|
||||
|
||||
x.AddSagaStateMachine<NovelImportSaga, NovelImportSagaState>()
|
||||
.EntityFrameworkRepository(r =>
|
||||
{
|
||||
r.ConcurrencyMode = ConcurrencyMode.Optimistic;
|
||||
r.ExistingDbContext<NovelServiceDbContext>();
|
||||
r.UsePostgres();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,9 +84,12 @@ public class Program
|
||||
|
||||
builder.Services.Configure<NovelUpdateServiceConfiguration>(builder.Configuration.GetSection("UpdateService"));
|
||||
builder.Services.AddTransient<NovelUpdateService>();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// Register IClock for saga and service use
|
||||
builder.Services.AddSingleton<IClock>(SystemClock.Instance);
|
||||
|
||||
builder.Services.AddHealthChecks();
|
||||
|
||||
// Authentication & Authorization
|
||||
|
||||
Reference in New Issue
Block a user