Yan Cui
1 min readSep 24, 2019

--

I would set the timeout on the whole AWS SDK operation (not at the http level). In node.js, using bluebird I can wrap the promise object returned by the SDK and then put a timeout on it. e.g.

const Promise = require('bluebird')...
Promise
.resolve(dynamodb.get(req).promise())
.timeout(getTimeout()) // calcaulated from time rem - reserved time for fallback actions
.catch(err => doFallback())

--

--

Yan Cui
Yan Cui

Written by Yan Cui

AWS Serverless Hero. Follow me to learn practical tips and best practices for AWS and Serverless.

No responses yet