Skip to content

Commit

Permalink
feat(cb2-7804): decrease sqs request timeout to 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian-Hodges authored Mar 16, 2023
1 parent 0f78d8d commit 85ac0a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/functions/edh-marshaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const edhMarshaller: Handler = async (event: DynamoDBStreamEvent): Promise<Batch
new SQS({
region: 'eu-west-1',
apiVersion: '2012-11-05',
httpOptions: {
timeout: 5000,
},
}),
);
}
Expand All @@ -68,7 +71,8 @@ const edhMarshaller: Handler = async (event: DynamoDBStreamEvent): Promise<Batch
sendMessagePromises.push(
sqs.sendMessage(params).promise()
.then(() => debugOnlyLog('Succesfully sent SQS message'))
.catch(() => {
.catch((err) => {
console.error(JSON.stringify(err));
console.error(`Failed to push SQS message for record: ${JSON.stringify(record)}`);
res.batchItemFailures.push({ itemIdentifier: id });
}),
Expand Down

0 comments on commit 85ac0a8

Please sign in to comment.