From dc8c44e581fb832f7fa36392a1e0d20d3fb4f647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Thu, 31 Oct 2024 14:39:43 +0100 Subject: [PATCH] Add missing eagerloads --- cron.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cron.py b/cron.py index 1f65c292..bb6fd978 100644 --- a/cron.py +++ b/cron.py @@ -905,10 +905,14 @@ def check_mailbox_valid_pgp_keys(): def check_custom_domain(): # Delete custom domains that haven't been verified in a month - for custom_domain in CustomDomain.filter( - CustomDomain.verified == False, # noqa: E712 - CustomDomain.created_at < arrow.now().shift(months=-1), - ).yield_per(100): + for custom_domain in ( + CustomDomain.filter( + CustomDomain.verified == False, # noqa: E712 + CustomDomain.created_at < arrow.now().shift(months=-1), + ) + .enable_eagerloads(False) + .yield_per(100) + ): alias_count = Alias.filter(Alias.custom_domain_id == custom_domain.id).count() if alias_count > 0: LOG.warn(