Skip to content

Commit 0406079

Browse files
committed
bug-fix: Do not prematurely expire keys
Previously keys would be expired after 30 days even if the Stripe subscription were still active. Now they will only be expired 30 days after the last payment/cancellation in Stripe.
1 parent 299edd8 commit 0406079

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/core/worker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ async def monitor_teams(db: Session):
432432
# Get all keys for the team grouped by region
433433
keys_by_region = get_team_keys_by_region(db, team.id)
434434
expire_keys = False
435-
if days_remaining <= 0 and should_send_notifications:
435+
# If the team has a product, expiry will be handled by a Stripe cancellation
436+
if not has_products and days_remaining <= 0 and should_send_notifications:
436437
expire_keys = True
437438

438439
# Monitor keys and get total spend

0 commit comments

Comments
 (0)