[FA-misc] Mass transit overhaul, needs testing and review
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using FictionArchive.Service.Shared.MassTransit.Contracts.Commands;
|
||||
using MassTransit;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Services.Consumers;
|
||||
|
||||
public class ImportNovelCommandConsumer : IConsumer<ImportNovelCommand>
|
||||
{
|
||||
private readonly ILogger<ImportNovelCommandConsumer> _logger;
|
||||
private readonly NovelUpdateService _novelUpdateService;
|
||||
|
||||
public ImportNovelCommandConsumer(
|
||||
ILogger<ImportNovelCommandConsumer> logger,
|
||||
NovelUpdateService novelUpdateService)
|
||||
{
|
||||
_logger = logger;
|
||||
_novelUpdateService = novelUpdateService;
|
||||
}
|
||||
|
||||
public async Task Consume(ConsumeContext<ImportNovelCommand> context)
|
||||
{
|
||||
var command = context.Message;
|
||||
_logger.LogInformation("Processing ImportNovelCommand for URL: {NovelUrl}", command.NovelUrl);
|
||||
|
||||
await _novelUpdateService.ImportNovel(command.NovelUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user