File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -219,5 +219,6 @@ def includeme(config):
219
219
# Add a periodic task to generate Account metrics
220
220
config .add_periodic_task (crontab (minute = "*/20" ), compute_user_metrics )
221
221
config .add_periodic_task (crontab (minute = "*" ), notify_users_of_tos_update )
222
- # TODO: After initial backfill, this can be done less frequently
223
- config .add_periodic_task (crontab (minute = "*/5" ), batch_update_email_domain_status )
222
+ config .add_periodic_task (
223
+ crontab (minute = "0" , hour = 4 ), batch_update_email_domain_status
224
+ )
Original file line number Diff line number Diff line change @@ -159,17 +159,14 @@ def batch_update_email_domain_status(request: Request) -> None:
159
159
stmt = (
160
160
select (Email )
161
161
.where (
162
- # TODO: After completely backfilled, remove the `or_` for None
163
162
or_ (
164
163
Email .domain_last_checked .is_ (None ),
165
164
Email .domain_last_checked < datetime .now (tz = UTC ) - timedelta (days = 30 ),
166
165
)
167
166
)
168
167
.order_by (nullsfirst (Email .domain_last_checked .asc ()))
169
- .limit (10_000 )
168
+ .limit (1_000 )
170
169
)
171
- # Run in batches to avoid too much memory usage, API rate limits
172
- stmt = stmt .execution_options (yield_per = 1_000 )
173
170
174
171
for email in request .db .scalars (stmt ):
175
172
update_email_domain_status (email , request )
You can’t perform that action at this time.
0 commit comments