Use operations kind

This commit is contained in:
2025-11-17 15:43:58 +09:00
parent a4055bee7e
commit 88f4d8ba2d
4 changed files with 25 additions and 11 deletions

View File

@ -25,20 +25,34 @@ namespace Hcs.WebApp.Services
select campaign).ToListAsync();
}
public async Task<IEnumerable<Operation>> GetNotExecutedOperationsAsync()
public async Task<IEnumerable<Operation>> GetNotExecutedRemoteOperationsAsync()
{
using var context = GetNewContext();
return await (from operation in context.Operations
where string.IsNullOrEmpty(operation.MessageGuid) && !operation.EndedAt.HasValue
select operation).ToListAsync();
var query = from operation in context.Operations
where string.IsNullOrEmpty(operation.MessageGuid) && !operation.EndedAt.HasValue
select operation;
var result = await query.ToListAsync();
return result.Where(x => x.Kind == Operation.OperationKind.Remote);
}
public async Task<IEnumerable<Operation>> GetResultWaitingOperationsAsync()
public async Task<IEnumerable<Operation>> GetResultWaitingRemoteOperationsAsync()
{
using var context = GetNewContext();
return await (from operation in context.Operations
where !string.IsNullOrEmpty(operation.MessageGuid) && !operation.EndedAt.HasValue
select operation).ToListAsync();
var query = from operation in context.Operations
where !string.IsNullOrEmpty(operation.MessageGuid) && !operation.EndedAt.HasValue
select operation;
var result = await query.ToListAsync();
return result.Where(x => x.Kind == Operation.OperationKind.Remote);
}
public async Task<IEnumerable<Operation>> GetNotCompletedParseOperationsAsync()
{
using var context = GetNewContext();
var query = from operation in context.Operations
where !operation.EndedAt.HasValue
select operation;
var result = await query.ToListAsync();
return result.Where(x => x.Kind == Operation.OperationKind.Parse);
}
public async Task<ICollection<Operation>> GetOperationsAsync()