Skip to content

Commit

Permalink
[pm-5966] Fix Entity Framework query for MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyVo16 committed Dec 19, 2024
1 parent eb7454b commit 7c9b3af
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,13 @@ from s in sJoin.DefaultIfEmpty()
using var scope = ServiceScopeFactory.CreateScope();
var dbContext = GetDatabaseContext(scope);

//Get domains that have not been verified after 72 hours
var domains = await dbContext.OrganizationDomains
.Where(x => (DateTime.UtcNow - x.CreationDate).Days == 4
&& x.VerifiedDate == null)
var unverifiedDomainsInLast72Hours = await dbContext.OrganizationDomains
.Where(x => x.CreationDate.Date >= DateTime.UtcNow.AddDays(-4).Date
&& x.VerifiedDate == null)

Check warning on line 152 in src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs

View check run for this annotation

Codecov / codecov/patch

src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs#L150-L152

Added lines #L150 - L152 were not covered by tests
.AsNoTracking()
.ToListAsync();

return Mapper.Map<List<Core.Entities.OrganizationDomain>>(domains);
return Mapper.Map<List<Core.Entities.OrganizationDomain>>(unverifiedDomainsInLast72Hours);

Check warning on line 156 in src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs

View check run for this annotation

Codecov / codecov/patch

src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs#L156

Added line #L156 was not covered by tests
}

public async Task<bool> DeleteExpiredAsync(int expirationPeriod)
Expand Down

0 comments on commit 7c9b3af

Please sign in to comment.