stream notifications when collating zip files

we had issues where we had 150k 2nd class notifications, and the collate
task never ran properly, presumably because the volume of data being
returned was too big.

to try and help with this, we can switch to streaming rather than using
`.all` and building up lists of data. This should help, though the
initial query may be a problem still.
This commit is contained in:
Leo Hemsted
2020-10-23 10:21:52 +01:00
parent 6fbf12afeb
commit 4b61060d32
4 changed files with 10 additions and 9 deletions

View File

@@ -730,7 +730,7 @@ def dao_get_letters_to_be_printed(print_run_deadline, postage):
).order_by(
Notification.service_id,
Notification.created_at
).all()
)
return notifications