tidy up bulk_sns_publish a bit more
- ID
ec3ff56- date
2023-04-16 18:26:25+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
7cfc8de- message
tidy up bulk_sns_publish a bit more- changed files
1 file, 4 additions, 3 deletions
Changed files
aws/bulk_sns_publish (4523) → aws/bulk_sns_publish (4602)
diff --git a/aws/bulk_sns_publish b/aws/bulk_sns_publish
index 5017617..7067a83 100755
--- a/aws/bulk_sns_publish
+++ b/aws/bulk_sns_publish
@@ -125,8 +125,9 @@ def publish_batch(sns_client, topic_arn, batch_entries):
)
# This is to account for any failures in sending messages to SNS.
- # I've never actually had this happen in practice so what should happen
- # here is a little bit
+ # I've never actually had this happen in practice so I've not written
+ # any code to handle it (I'd probably just retry the whole script)
+ # but I include it just in case.
assert len(resp['Failed']) == 0, resp
@@ -146,7 +147,7 @@ def publish_messages(*, input_file, topic_arn):
for (batch, _) in concurrently(
handler=functools.partial(publish_batch, sns_client, topic_arn),
inputs=get_batch_entries(input_file),
- max_concurrency=1
+ max_concurrency=8
):
pbar.update(len(batch))