mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
reduce memory use in cron by using yield_per()
This commit is contained in:
parent
b79933ba4c
commit
84381e9635
1 changed files with 1 additions and 1 deletions
2
cron.py
2
cron.py
|
@ -179,7 +179,7 @@ def stats_before(moment: Arrow) -> Stats:
|
|||
q = q.filter(~User.email.contains(ie))
|
||||
|
||||
nb_spam = nb_bounced = nb_forward = nb_block = nb_reply = 0
|
||||
for email_log in q:
|
||||
for email_log in q.yield_per(500):
|
||||
if email_log.bounced:
|
||||
nb_bounced += 1
|
||||
elif email_log.is_spam:
|
||||
|
|
Loading…
Reference in a new issue