Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pm-5966] Fix Entity Framework query for MySQL #5170

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,13 @@
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
r-tome marked this conversation as resolved.
Show resolved Hide resolved
&& 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
Loading