Skip to content

Commit

Permalink
#1295 make stats get_number_of_recent_subscription_cancellations coun…
Browse files Browse the repository at this point in the history
…t consistent with listed subscriptions
  • Loading branch information
chrisjsimpson committed Feb 10, 2024
1 parent 1cddf86 commit 3149c2c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions subscribie/blueprints/admin/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,13 @@ def get_number_of_recent_subscription_cancellations():
types=["customer.subscription.deleted"],
)

for event in subscription_cancellations.auto_paging_iter():
log.info("appending event")
log.info(
f"Length of subscription_cancellations.data is {len(subscription_cancellations.data)}" # noqa: E501
)
if len(subscription_cancellations.data) > 100:
break
subscription_cancellations.data.append(event)

return len(subscription_cancellations)

0 comments on commit 3149c2c

Please sign in to comment.