mirror of
https://github.com/simple-login/app.git
synced 2025-10-02 19:35:52 +08:00
Add missing eager load for apple
This commit is contained in:
parent
dc8c44e581
commit
b516b8343b
1 changed files with 7 additions and 3 deletions
10
cron.py
10
cron.py
|
@ -286,9 +286,13 @@ def notify_manual_sub_end():
|
|||
|
||||
def poll_apple_subscription():
|
||||
"""Poll Apple API to update AppleSubscription"""
|
||||
for apple_sub in AppleSubscription.filter(
|
||||
AppleSubscription.expires_date < arrow.now().shift(days=15)
|
||||
).yield_per(100):
|
||||
for apple_sub in (
|
||||
AppleSubscription.filter(
|
||||
AppleSubscription.expires_date < arrow.now().shift(days=15)
|
||||
)
|
||||
.enable_eagerloads(False)
|
||||
.yield_per(100)
|
||||
):
|
||||
if not apple_sub.is_valid():
|
||||
# Subscription is not valid anymore and hasn't been renewed
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue