dynamodb icon indicating copy to clipboard operation
dynamodb copied to clipboard

Throughput capacity is not updated while updating table

Open NikhilManapure opened this issue 6 years ago • 1 comments

https://github.com/baseprime/dynamodb/blob/master/lib/createTables.js

Throughput capacity is not updated while updating table

NikhilManapure avatar Aug 29 '18 12:08 NikhilManapure

I am also facing the same issue.In the below code, no options parameter is passed while updateTable method is called.

internals.createTable = function (model, options, callback) {
  options = options || {};

  var tableName = model.tableName();

  model.describeTable(function (err, data) {
    if(_.isNull(data) || _.isUndefined(data)) {
      model.log.info('creating table: %s', tableName);
      return model.createTable(options, function (error) {

        if(error) {
          model.log.warn({err : error}, 'failed to create table %s: %s', tableName, error);
          return callback(error);
        }

        model.log.info('waiting for table: %s to become ACTIVE', tableName);
        internals.waitTillActive(model, callback);
      });
    } else {
      model.updateTable(function (err) {
        if(err) {
          model.log.warn({err : err}, 'failed to update table %s: %s', tableName, err);
          return callback(err);
        }

        model.log.info('waiting for table: %s to become ACTIVE', tableName);
        internals.waitTillActive(model, callback);
      });
    }
  });
};

jkvora avatar Aug 29 '18 12:08 jkvora