Skip to content

Commit a1564e7

Browse files
committed
named options to pause db once seeding is complete
1 parent 3712fc6 commit a1564e7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ All CLI options are optional:
5757
--migrate -m After starting DynamoDB local, create DynamoDB tables from the Serverless configuration.
5858
--seed -s After starting and migrating dynamodb local, injects seed data into your tables. The --seed option determines which data categories to onload.
5959
--convertEmptyValues -e Set to true if you would like the document client to convert empty values (0-length strings, binary buffers, and sets) to be converted to NULL types when persisting to DynamoDB.
60-
--userStop After starting dynamodb local and all migrations and seeding is completed (if set to run), process will stay open until user terminates running process. When terminate signal received, it will stop the database on the running port.
60+
--pauseDbAfterSeeding -p After starting dynamodb local and all migrations and seeding is completed (if set to run), process will stay open until user terminates running process. When terminate signal received, it will stop the database on the running port.
6161
```
6262

6363
All the above options can be added to serverless.yml to set default configuration: e.g.
@@ -76,7 +76,7 @@ custom:
7676
migrate: true
7777
seed: true
7878
convertEmptyValues: true
79-
userStop: true
79+
pauseDbAfterSeeding: true
8080
# Uncomment only if you already have a DynamoDB running locally
8181
# noStart: true
8282
```

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ServerlessDynamodbLocal {
8989
shortcut: "e",
9090
usage: "Set to true if you would like the document client to convert empty values (0-length strings, binary buffers, and sets) to be converted to NULL types when persisting to DynamoDB.",
9191
},
92-
userStop: {
92+
pauseDbAfterSeeding: {
9393
usage: "After starting dynamodb local and all migrations and seeding is completed (if set to run), process will stay open until user terminates running process. When terminate signal received, it will stop the database on the running port."
9494
}
9595
}
@@ -233,7 +233,7 @@ class ServerlessDynamodbLocal {
233233
.then(() => options.migrate && this.migrateHandler())
234234
.then(() => options.seed && this.seedHandler())
235235
.then(() => {
236-
if (options.userStop) {
236+
if (options.pauseDbAfterSeeding) {
237237
this.serverlessLog("DynamoDB - Database is running. Waiting for user to stop...");
238238
return BbPromise.resolve()
239239
.then(() => this._listenForTermination())

0 commit comments

Comments
 (0)