Merge pull request #2986 from codecombat/master

Enable Sao Paulo servers
This commit is contained in:
Michael Schmatz 2015-09-02 13:39:52 -04:00
commit 583d415796
2 changed files with 5 additions and 1 deletions

View file

@ -23,6 +23,8 @@ module.exports.connect = () ->
module.exports.generateMongoConnectionString = ->
if not testing and config.tokyo
address = config.mongo.mongoose_tokyo_replica_string
else if not testing and config.saoPaulo
address = config.mongo.mongoose_saoPaulo_replica_string
else if not testing and config.mongo.mongoose_replica_string
address = config.mongo.mongoose_replica_string
else

View file

@ -3,6 +3,7 @@ config = {}
config.unittest = process.argv.indexOf('--unittest') > -1
config.tokyo = process.env.TOKYO or false
config.saoPaulo = process.env.SAOPAULO or false
config.chinaDomain = "http://cn.codecombat.com"
config.port = process.env.COCO_PORT or process.env.COCO_NODE_PORT or 3000
config.ssl_port = process.env.COCO_SSL_PORT or process.env.COCO_SSL_NODE_PORT or 3443
@ -22,8 +23,9 @@ config.mongo =
analytics_db: process.env.COCO_MONGO_ANALYTICS_DATABASE_NAME or 'analytics'
mongoose_replica_string: process.env.COCO_MONGO_MONGOOSE_REPLICA_STRING or ''
mongoose_tokyo_replica_string: process.env.COCO_MONGO_MONGOOSE_TOKYO_REPLICA_STRING or ''
mongoose_saoPaulo_replica_string : process.env.COCO_MONGO_MONGOOSE_SAOPAULO_REPLICA_STRING or ''
if config.tokyo
if config.tokyo or config.saoPaulo
config.mongo.readpref = 'nearest'
else
config.mongo.readpref = 'primary'