diff --git a/lib/dynamo-restore.js b/lib/dynamo-restore.js index b341fb8..8325fbf 100755 --- a/lib/dynamo-restore.js +++ b/lib/dynamo-restore.js @@ -33,6 +33,9 @@ function DynamoRestore(options) { this.options = options; this.dynamodb = new AWS.DynamoDB(); + + this.batches = []; // Initialize batches as an empty array + this.requestItems = []; // Initialize requestItems as an empty array } // Stick to prototypal inheritance. While this can be done differently @@ -122,6 +125,9 @@ DynamoRestore.prototype._checkTableExists = function(error, data) { }; DynamoRestore.prototype._startDownload = function() { + this.batches = this.batches || []; + this.requestItems = this.requestItems || []; + var s3 = new AWS.S3(); var params = { Bucket: this.options.s3bucket,