Rename wait to get
This commit is contained in:
@ -7,8 +7,8 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
public class ExportCommonRegistryElementsManager_15_7_0_1(
|
||||
IServiceScopeFactory scopeFactory,
|
||||
OperationExecutionState operationExecutionState,
|
||||
ResultWaitState resultWaitState,
|
||||
Campaign campaign) : ManagerBase(scopeFactory, operationExecutionState, resultWaitState, campaign)
|
||||
ResultGetState resultGetState,
|
||||
Campaign campaign) : ManagerBase(scopeFactory, operationExecutionState, resultGetState, campaign)
|
||||
{
|
||||
private enum Step
|
||||
{
|
||||
@ -97,14 +97,14 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
{
|
||||
if (!string.IsNullOrEmpty(operation.MessageGuid))
|
||||
{
|
||||
resultWaitState.EnqueueOperation(operation);
|
||||
resultGetState.EnqueueOperation(operation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DoResultWaitStepAsync()
|
||||
{
|
||||
if (resultWaitState.HasCampaignOperation(campaign.Id)) return;
|
||||
if (resultGetState.HasCampaignOperation(campaign.Id)) return;
|
||||
|
||||
DateTime endedAt = default;
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
public class ExportPrivateRegistryElementsManager_15_7_0_1(
|
||||
IServiceScopeFactory scopeFactory,
|
||||
OperationExecutionState operationExecutionState,
|
||||
ResultWaitState resultWaitState,
|
||||
Campaign campaign) : ManagerBase(scopeFactory, operationExecutionState, resultWaitState, campaign)
|
||||
ResultGetState resultGetState,
|
||||
Campaign campaign) : ManagerBase(scopeFactory, operationExecutionState, resultGetState, campaign)
|
||||
{
|
||||
private enum Step
|
||||
{
|
||||
@ -97,14 +97,14 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
{
|
||||
if (!string.IsNullOrEmpty(operation.MessageGuid))
|
||||
{
|
||||
resultWaitState.EnqueueOperation(operation);
|
||||
resultGetState.EnqueueOperation(operation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DoResultWaitStepAsync()
|
||||
{
|
||||
if (resultWaitState.HasCampaignOperation(campaign.Id)) return;
|
||||
if (resultGetState.HasCampaignOperation(campaign.Id)) return;
|
||||
|
||||
DateTime endedAt = default;
|
||||
|
||||
|
||||
@ -7,12 +7,12 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
public abstract class ManagerBase(
|
||||
IServiceScopeFactory scopeFactory,
|
||||
OperationExecutionState operationExecutionState,
|
||||
ResultWaitState resultWaitState,
|
||||
ResultGetState resultGetState,
|
||||
Campaign campaign) : IManager
|
||||
{
|
||||
protected readonly IServiceScope scope = scopeFactory.CreateScope();
|
||||
protected readonly OperationExecutionState operationExecutionState = operationExecutionState;
|
||||
protected readonly ResultWaitState resultWaitState = resultWaitState;
|
||||
protected readonly ResultGetState resultGetState = resultGetState;
|
||||
protected readonly Campaign campaign = campaign;
|
||||
|
||||
private HeadquartersService? headquartersService;
|
||||
|
||||
@ -2,19 +2,19 @@
|
||||
|
||||
namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
{
|
||||
public class ManagerFactory(IServiceScopeFactory serviceScopeFactory, OperationExecutionState operationExecutionState, ResultWaitState resultWaitState)
|
||||
public class ManagerFactory(IServiceScopeFactory serviceScopeFactory, OperationExecutionState operationExecutionState, ResultGetState resultGetState)
|
||||
{
|
||||
protected readonly IServiceScopeFactory serviceScopeFactory = serviceScopeFactory;
|
||||
protected readonly OperationExecutionState operationExecutionState = operationExecutionState;
|
||||
protected readonly ResultWaitState resultWaitState = resultWaitState;
|
||||
protected readonly ResultGetState resultGetState = resultGetState;
|
||||
|
||||
public IManager CreateManager(Campaign campaign)
|
||||
{
|
||||
return campaign.Type switch
|
||||
{
|
||||
Campaign.CampaignType.ExportPrivateRegistryElements_15_7_0_1 => new ExportPrivateRegistryElementsManager_15_7_0_1(serviceScopeFactory, operationExecutionState, resultWaitState, campaign),
|
||||
Campaign.CampaignType.ExportCommonRegistryElements_15_7_0_1 => new ExportCommonRegistryElementsManager_15_7_0_1(serviceScopeFactory, operationExecutionState, resultWaitState, campaign),
|
||||
Campaign.CampaignType.ParseHousesData_15_7_0_1 => new ParseHousesDataManager_15_7_0_1(serviceScopeFactory, operationExecutionState, resultWaitState, campaign)
|
||||
Campaign.CampaignType.ExportPrivateRegistryElements_15_7_0_1 => new ExportPrivateRegistryElementsManager_15_7_0_1(serviceScopeFactory, operationExecutionState, resultGetState, campaign),
|
||||
Campaign.CampaignType.ExportCommonRegistryElements_15_7_0_1 => new ExportCommonRegistryElementsManager_15_7_0_1(serviceScopeFactory, operationExecutionState, resultGetState, campaign),
|
||||
Campaign.CampaignType.ParseHousesData_15_7_0_1 => new ParseHousesDataManager_15_7_0_1(serviceScopeFactory, operationExecutionState, resultGetState, campaign)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
public class ParseHousesDataManager_15_7_0_1(
|
||||
IServiceScopeFactory scopeFactory,
|
||||
OperationExecutionState operationExecutionState,
|
||||
ResultWaitState resultWaitState,
|
||||
Campaign campaign) : ManagerBase(scopeFactory, operationExecutionState, resultWaitState, campaign)
|
||||
ResultGetState resultGetState,
|
||||
Campaign campaign) : ManagerBase(scopeFactory, operationExecutionState, resultGetState, campaign)
|
||||
{
|
||||
protected override int StepCount => throw new NotImplementedException();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user