From 41cbe74c623765ed309471d69434dccb74b877d8 Mon Sep 17 00:00:00 2001 From: Alex Goth <64845621+GAlexIHU@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:16:32 +0200 Subject: [PATCH] fix: exclude deleted entitlements from autoreset (#1285) --- internal/entitlement/postgresadapter/entitlement.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/entitlement/postgresadapter/entitlement.go b/internal/entitlement/postgresadapter/entitlement.go index 9df01ba6d..896ce5fd3 100644 --- a/internal/entitlement/postgresadapter/entitlement.go +++ b/internal/entitlement/postgresadapter/entitlement.go @@ -356,6 +356,7 @@ func (a *entitlementDBAdapter) ListEntitlementsWithExpiredUsagePeriod(ctx contex db_entitlement.Namespace(namespace), db_entitlement.CurrentUsagePeriodEndNotNil(), db_entitlement.CurrentUsagePeriodEndLTE(expiredBefore), + db_entitlement.Or(db_entitlement.DeletedAtIsNil(), db_entitlement.DeletedAtGT(clock.Now())), ). All(ctx) if err != nil {