Skip to content

Commit

Permalink
Collapse query
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Oct 16, 2024
1 parent 8cd99a4 commit 6ddce79
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ protected override async Task DoWorkAsync(IServiceScope scope, CancellationToken

public async Task CheckEntitiesAsync(IRepository<T> entities, CancellationToken cancellationToken)
{
IReadOnlyList<T> allEntities = await entities.GetAllAsync(cancellationToken);
var now = DateTime.UtcNow;
IEnumerable<T> uninitializedEntities = allEntities.Where(b =>
IEnumerable<T> uninitializedEntities = (await entities.GetAllAsync(cancellationToken)).Where(b =>
!(b.IsInitialized ?? true) && (now - (b.DateCreated ?? DateTime.UtcNow)) > _timeout
);
foreach (T entity in uninitializedEntities)
Expand Down

0 comments on commit 6ddce79

Please sign in to comment.