Skip to content

Commit ce32834

Browse files
authored
bug fixing startHandler
1 parent 490f842 commit ce32834

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,11 @@ class ServerlessDynamodbLocal {
168168
});
169169
}
170170

171-
executeAllHandler() {
172-
let self = this;
171+
executeAllHandler(isOffline) {
172+
let self = this,
173+
region = isOffline ? null :self.service.provider.region
173174
return new BbPromise(function(resolve, reject) {
174-
let dynamodb = self.dynamodbOptions(self.service.provider.region),
175+
let dynamodb = self.dynamodbOptions(region),
175176
tableOptions = self.tableOptions();
176177
dynamodbMigrations.init(dynamodb, tableOptions.path);
177178
dynamodbMigrations.executeAll(tableOptions).then(resolve, reject);
@@ -206,7 +207,7 @@ class ServerlessDynamodbLocal {
206207
if (options.migration) {
207208
dynamodbLocal.start(options);
208209
console.log(""); // seperator
209-
self.executeAllHandler();
210+
self.executeAllHandler(true);
210211
resolve();
211212
} else {
212213
dynamodbLocal.start(options);

0 commit comments

Comments
 (0)