Browse Source

Made correction to the domain used to domains that have been unverified after 72 hours. Instead of doing a greater than or equal to the condition is set to a fixed period 4, so domains after 4 days which are uneverified would not be picked up by the service (#2729)

pull/2736/head
SmithThe4th 3 years ago committed by GitHub
parent
commit
1c66365e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs
  2. 5
      src/Sql/dbo/Stored Procedures/OrganizationDomain_ReadIfExpired.sql
  3. 14
      util/Migrator/DbScripts/2023-02-22_FixReturningExpiredDomainsAfterSpecifiedPeriod.sql

2
src/Infrastructure.EntityFramework/Repositories/OrganizationDomainRepository.cs

@ -119,7 +119,7 @@ public class OrganizationDomainRepository : Repository<Core.Entities.Organizatio @@ -119,7 +119,7 @@ public class OrganizationDomainRepository : Repository<Core.Entities.Organizatio
//Get domains that have not been verified after 72 hours
var domains = dbContext.OrganizationDomains
.AsEnumerable()
.Where(x => (DateTime.UtcNow - x.CreationDate).Days >= 4
.Where(x => (DateTime.UtcNow - x.CreationDate).Days == 4
&& x.VerifiedDate == null)
.ToList();

5
src/Sql/dbo/Stored Procedures/OrganizationDomain_ReadIfExpired.sql

@ -8,6 +8,7 @@ BEGIN @@ -8,6 +8,7 @@ BEGIN
FROM
[dbo].[OrganizationDomain]
WHERE
DATEDIFF(DAY, [CreationDate], GETUTCDATE()) >= 4 --Get domains that have not been verified after 3 days (72 hours)
DATEDIFF(DAY, [CreationDate], GETUTCDATE()) = 4 --Get domains that have not been verified after 3 days (72 hours)
AND
[VerifiedDate] IS NULL
[VerifiedDate] IS NULL
END

14
util/Migrator/DbScripts/2023-02-22_FixReturningExpiredDomainsAfterSpecifiedPeriod.sql

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
CREATE OR ALTER PROCEDURE [dbo].[OrganizationDomain_ReadIfExpired]
AS
BEGIN
SET NOCOUNT OFF
SELECT
*
FROM
[dbo].[OrganizationDomain]
WHERE
DATEDIFF(DAY, [CreationDate], GETUTCDATE()) = 4 --Get domains that have not been verified after 3 days (72 hours)
AND
[VerifiedDate] IS NULL
END
Loading…
Cancel
Save