Skip to content

Commit

Permalink
fix: treat inactive entitlement as deleted (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
turip authored Oct 29, 2024
1 parent d0c308e commit 1d2b300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openmeter/entitlement/balanceworker/recalculate.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (r *Recalculator) processEntitlements(ctx context.Context, entitlements []e
}

func (r *Recalculator) sendEntitlementEvent(ctx context.Context, ent entitlement.Entitlement) error {
if ent.DeletedAt != nil {
if ent.DeletedAt != nil || (ent.ActiveTo != nil && time.Now().After(*ent.ActiveTo)) {
return r.sendEntitlementDeletedEvent(ctx, ent)
}

Expand Down

0 comments on commit 1d2b300

Please sign in to comment.