mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
change timing a bit
This commit is contained in:
@@ -78,13 +78,14 @@ def process_job(job_id, sender_id=None):
|
|||||||
|
|
||||||
# notify-api-1495 we are going to sleep periodically to give other
|
# notify-api-1495 we are going to sleep periodically to give other
|
||||||
# jobs running at the same time a chance to get some of their messages
|
# jobs running at the same time a chance to get some of their messages
|
||||||
# sent. Sleep for 5 minutes after every 500 sends
|
# sent. Sleep for 40 seconds after every 100 sends, which gives us throughput
|
||||||
|
# of about 9000 per hour and would keep the queue clear assuming only one sender.
|
||||||
count = 0
|
count = 0
|
||||||
for row in recipient_csv.get_rows():
|
for row in recipient_csv.get_rows():
|
||||||
process_row(row, template, job, service, sender_id=sender_id)
|
process_row(row, template, job, service, sender_id=sender_id)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
if count % 500 == 0:
|
if count % 100 == 0:
|
||||||
sleep(5 * 60)
|
sleep(40)
|
||||||
|
|
||||||
# End point/Exit point for message send flow.
|
# End point/Exit point for message send flow.
|
||||||
job_complete(job, start=start)
|
job_complete(job, start=start)
|
||||||
|
|||||||
Reference in New Issue
Block a user