Skip to content

Commit 4eb0584

Browse files
authored
Add documentation on COUCH2PG_USERS_META_DOC_LIMIT and add safeNum safety (#100)
1 parent 3e38727 commit 4eb0584

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ The supported environment variables are:
2020
| -------------------- | ---------------------------------------------------------------------------------------------------------- |
2121
| POSTGRESQL_URL | PostgreSQL instance URL, format: `postgres://[user]:[password]@localhost:[port]/[database name]` |
2222
| COUCHDB_URL | CouchDB instance URL, format: `https://[user]:[password]@localhost:[port]/medic` |
23-
| COUCH2PG_SLEEP_MINS | Number of minutes between synchronization |
23+
| COUCH2PG_SLEEP_MINS | Number of minutes between synchronization. It defaults to 50 if this variable is not explicitly set. |
2424
| COUCH2PG_DOC_LIMIT | Number of documents cht-couch2pg fetches from CouchDB everytime |
2525
| COUCH2PG_RETRY_COUNT | Number of times cht-couch2pg will retry synchronizing documents from CouchDB after experiencing an error |
26+
| COUCH2PG_USERS_META_DOC_LIMIT | Number of documents to grab concurrently from the users-meta database. These documents are larger so set a limit lower than the docLimit. It defaults to 50 if this variable is not explicitly set. |
2627

2728
Example:
2829
```

env.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function() {
1616
docLimit: safeNum(process.env.COUCH2PG_DOC_LIMIT),
1717
changesLimit: safeNum(process.env.COUCH2PG_CHANGES_LIMIT),
1818
retryCount: safeNum(process.env.COUCH2PG_RETRY_COUNT),
19-
sleepMins: (safeNum(process.env.COUCH2PG_SLEEP_MINS) || 60),
20-
couchdbUsersMetaDocLimit: process.env.COUCH2PG_USERS_META_DOC_LIMIT || 50,
19+
sleepMins: safeNum(process.env.COUCH2PG_SLEEP_MINS) || 60,
20+
couchdbUsersMetaDocLimit: safeNum(process.env.COUCH2PG_USERS_META_DOC_LIMIT) || 50,
2121
};
2222
};

0 commit comments

Comments
 (0)