clarkie / dynogels

DynamoDB data mapper for node.js. Originally forked from https://github.com/ryanfitz/vogels
Other
490 stars 110 forks source link

Allow specification of polling delay when creating tables #27

Closed cdhowie closed 7 years ago

cdhowie commented 8 years ago

It would be nice to be able to specify a custom value for the DescribeTable poll rate when creating tables. For service tests, we're using Dynalite to mock DynamoDB, and it can be configured to create tables instantly. Waiting 1sec per table causes fairly significant test startup delay.

cdhowie commented 8 years ago

The least-intrusive place I can find to specify this is on the model's config, since internals.waitTillActive has access to the model. However, this requires it to be specified per table, in the schema.

Perhaps it would make more sense to extend the second argument to createTables? Right now it is supposed to be a bunch of objects keyed by table name. Perhaps we can add a special $dynogels key to hold extra config information like this?

dynogels.createTables({ $dynogels: { pollingDelay: 50 } }, (err, results) => ...)