79169041

Date: 2024-11-08 06:46:08
Score: 1
Natty:
Report link

While you already set connectTimeout to 10 seconds, you might want to set both the socketTimeout (for read/write operations) and maxAttempts (for retries) explicitly.

export const KINESIS_CLIENT = new KinesisClient({ region: 'us-west-2', maxAttempts: 3, // Allows more retry attempts requestHandler: new NodeHttpHandler({ connectionTimeout: 20000, // 20 seconds connection timeout socketTimeout: 20000 // 20 seconds socket timeout }) });

Improved Error Handling

promises.push(processEvent(body).catch((err) => { console.error("Error processing record:", err); return err; // Capture error instead of failing immediately }));

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: SubhrahmanyamNakkana