fix(templateGeneratorWorker): MqSettings
This commit is contained in:
@@ -4,7 +4,6 @@ using PARR.BLL.Domain.Mq;
|
|||||||
using PARR.BLL.Services.Interfaces;
|
using PARR.BLL.Services.Interfaces;
|
||||||
using PARR.TemplateDistributor.Services;
|
using PARR.TemplateDistributor.Services;
|
||||||
using PARR.TemplateDistributor.Settings;
|
using PARR.TemplateDistributor.Settings;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PARR.TemplateDistributor
|
namespace PARR.TemplateDistributor
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
namespace PARR.TemplateGeneratorWorker.Settings
|
namespace PARR.TemplateGeneratorWorker.Settings
|
||||||
{
|
{
|
||||||
public class MqSettings : IMqSettings//TODO почему-то только публик работает
|
public class MqSettings : IMqSettings
|
||||||
{
|
{
|
||||||
public string HostName { get; set; } = string.Empty;
|
public string HostName { get; set; } = string.Empty;
|
||||||
public string QueueName { get; set; } = string.Empty;
|
public string QueueName { get; set; } = string.Empty;
|
||||||
public string User { get; set; } = string.Empty;
|
public string User { get; set; } = string.Empty;
|
||||||
public string Password { get; set; } = string.Empty;
|
public string Password { get; set; } = string.Empty;
|
||||||
|
public ushort? PrefetchCount { get; set; } = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,21 @@
|
|||||||
using PARR.BLL.Contracts.Interfaces;
|
|
||||||
using PARR.BLL.Services.Interfaces;
|
using PARR.BLL.Services.Interfaces;
|
||||||
using PARR.DAL.DomainServices.Interfaces;
|
|
||||||
using PARR.DAL.Services.Interfaces;
|
|
||||||
using PARR.DAL.Services.Interfaces.Job;
|
|
||||||
using PARR.TemplateGeneratorWorker.Services;
|
|
||||||
using PARR.TemplateGeneratorWorker.Settings;
|
using PARR.TemplateGeneratorWorker.Settings;
|
||||||
|
|
||||||
namespace PARR.TemplateGeneratorWorker
|
namespace PARR.TemplateGeneratorWorker
|
||||||
{
|
{
|
||||||
public class Worker : BackgroundService
|
public class Worker : BackgroundService
|
||||||
{
|
{
|
||||||
private readonly ILogger<Worker> logger;
|
|
||||||
private readonly IMqSettings mqSettings;
|
private readonly MqSettings mqSettings;
|
||||||
private readonly IMqService mqService;
|
private readonly IMqService mqService;
|
||||||
private readonly IServiceProvider serviceProvider;
|
private readonly IServiceProvider serviceProvider;
|
||||||
private readonly ITransformService transformService;
|
|
||||||
private readonly IValidatorService validatorService;
|
|
||||||
private readonly IJobService jobService;
|
|
||||||
private readonly IShortcodesService shortcodesService;
|
|
||||||
private readonly ITemplateService templateService;
|
|
||||||
|
|
||||||
public Worker(
|
public Worker(
|
||||||
ILogger<Worker> logger,
|
|
||||||
MqSettings mqSettings,
|
MqSettings mqSettings,
|
||||||
IMqService mqService,
|
IMqService mqService,
|
||||||
IServiceProvider serviceProvider
|
IServiceProvider serviceProvider
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
|
||||||
this.mqSettings = mqSettings;
|
this.mqSettings = mqSettings;
|
||||||
this.mqService = mqService;
|
this.mqService = mqService;
|
||||||
this.serviceProvider = serviceProvider;
|
this.serviceProvider = serviceProvider;
|
||||||
@@ -35,10 +23,10 @@ namespace PARR.TemplateGeneratorWorker
|
|||||||
|
|
||||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
{
|
{
|
||||||
var isConnected = await mqService.InitConsumerAsync(mqSettings, GenerateTemplateAsync);
|
var isConnected = await mqService.InitConsumerAsync(mqSettings, GenerateTemplateAsync);
|
||||||
|
|
||||||
if (!isConnected)
|
if (!isConnected)
|
||||||
throw new Exception("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> RabbitMq");
|
throw new Exception("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> RabbitMq");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user