Change events args
This commit is contained in:
@ -8,16 +8,21 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
|
||||
{
|
||||
public class ExportNsiItemGetter_15_7_0_1(IClient client, IServiceScope scope, Operation operation) : ResultGetterBase(client, scope, operation)
|
||||
{
|
||||
public override async Task<bool> GetAsync()
|
||||
public override async Task<ResultGetterResponse> GetAsync()
|
||||
{
|
||||
var result = await client.NsiCommon.GetExportNsiItemResultAsync(operation.MessageGuid!);
|
||||
if (!result.Ready)
|
||||
{
|
||||
return false;
|
||||
return new ResultGetterResponse()
|
||||
{
|
||||
success = false
|
||||
};
|
||||
}
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
DateTime endedAt = default;
|
||||
|
||||
var headquartersService = scope.ServiceProvider.GetRequiredService<HeadquartersService>();
|
||||
var registryService = scope.ServiceProvider.GetRequiredService<RegistryService>();
|
||||
|
||||
@ -47,7 +52,8 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
|
||||
}
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
await headquartersService.SetOperationEndedAsync(context, operation.Id);
|
||||
endedAt = DateTime.UtcNow;
|
||||
await headquartersService.SetOperationEndedAsync(context, operation.Id, endedAt);
|
||||
|
||||
await transaction.CommitAsync();
|
||||
}
|
||||
@ -59,7 +65,11 @@ namespace Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
return new ResultGetterResponse()
|
||||
{
|
||||
success = true,
|
||||
endedAt = endedAt
|
||||
};
|
||||
}
|
||||
|
||||
throw Failure(result.ErrorMessage);
|
||||
|
||||
Reference in New Issue
Block a user