jeudi 26 février 2015

How to configure DynamoDB retryLimit and retryDelay?

I have pretty high traffic peaks, thus I'd like to overwrite the dynamodb retry limit and retry policy.


Somehow I'm not able to find the right config property to overwrite the retry limit and function.


my code so far



var aws = require( 'aws-sdk');
var table = new aws.DynamoDB({params: {TableName: 'MyTable'}});
aws.config.update({accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_KEY});
aws.config.region = 'eu-central-1';


I found the following amazon variables and code snippets, however I'm not sure how to wire this up with the config?



retryLimit: 15,
retryDelays: function retryDelays() {
var retryCount = this.numRetries();
var delays = [];
for (var i = 0; i < retryCount; ++i) {
if (i === 0) {
delays.push(0);
} else {
delays.push(60*1000 *i); // Retry every minute instead
// Amazon Defaultdelays.push(50 * Math.pow(2, i - 1));
}
}
return delays;
}




Aucun commentaire:

Enregistrer un commentaire