Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5052 from withspectrum/high-availability-db
Browse files Browse the repository at this point in the history
Connect to both RethinkDB portals in production
  • Loading branch information
brianlovin authored Apr 24, 2019
2 parents 8816c5f + 1f24ac5 commit 47dd013
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
2 changes: 2 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"COMPOSE_RETHINKDB_PASSWORD": "@github-compose-rethinkdb-password",
"COMPOSE_RETHINKDB_URL": "@github-compose-rethinkdb-url",
"COMPOSE_RETHINKDB_PORT": "@github-compose-rethinkdb-port",
"BACKUP_RETHINKDB_URL": "@backup-compose-rethinkdb-url",
"BACKUP_RETHINKDB_PORT": "@backup-compose-rethinkdb-port",
"AWS_RETHINKDB_PASSWORD": "@aws-rethinkdb-password",
"AWS_RETHINKDB_URL": "@aws-rethinkdb-url",
"AWS_RETHINKDB_PORT": "@aws-rethinkdb-port",
Expand Down
36 changes: 26 additions & 10 deletions shared/db/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,32 @@ if (!ca && IS_PROD)
);

const PRODUCTION_CONFIG = {
password: process.env.COMPOSE_RETHINKDB_PASSWORD,
host: process.env.COMPOSE_RETHINKDB_URL,
port: process.env.COMPOSE_RETHINKDB_PORT,
...(ca
? {
ssl: {
ca,
},
}
: {}),
servers: [
{
password: process.env.COMPOSE_RETHINKDB_PASSWORD,
host: process.env.COMPOSE_RETHINKDB_URL,
port: process.env.COMPOSE_RETHINKDB_PORT,
...(ca
? {
ssl: {
ca,
},
}
: {}),
},
{
password: process.env.COMPOSE_RETHINKDB_PASSWORD,
host: process.env.BACKUP_RETHINKDB_URL,
port: process.env.BACKUP_RETHINKDB_PORT,
...(ca
? {
ssl: {
ca,
},
}
: {}),
},
],
};

const config = IS_PROD
Expand Down

0 comments on commit 47dd013

Please sign in to comment.