Skip to content

Commit

Permalink
Also yield referral
Browse files Browse the repository at this point in the history
  • Loading branch information
acasajus committed Jul 31, 2023
1 parent 7276e1d commit e681535
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ def compute_metric2() -> Metric2:
_24h_ago = now.shift(days=-1)

nb_referred_user_paid = 0
for user in User.filter(User.referral_id.isnot(None)).yield_per_query():
for user in (
User.filter(User.referral_id.isnot(None))
.yield_per(500)
.enable_eagerloads(False)
):
if user.is_paid():
nb_referred_user_paid += 1

Expand Down

0 comments on commit e681535

Please sign in to comment.