mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Change how we connect to the analytics database.
This commit is contained in:
parent
3dcfa2cc8a
commit
888d43fc5c
2 changed files with 6 additions and 1 deletions
|
@ -30,7 +30,7 @@ AnalyticsLogEventSchema.statics.logEvent = (user, event, properties={}) ->
|
|||
|
||||
unless config.proxy
|
||||
analyticsMongoose = mongoose.createConnection()
|
||||
analyticsMongoose.open "mongodb://#{config.mongo.analytics_host}:#{config.mongo.analytics_port}/#{config.mongo.analytics_db}", (error) ->
|
||||
analyticsMongoose.open config.mongo.analytics_replica_string, (error) ->
|
||||
log.error "Couldn't connect to analytics", error if error
|
||||
|
||||
module.exports = AnalyticsLogEvent = analyticsMongoose.model('analytics.log.event', AnalyticsLogEventSchema, config.mongo.analytics_collection)
|
||||
|
|
|
@ -25,6 +25,11 @@ config.mongo =
|
|||
mongoose_replica_string: process.env.COCO_MONGO_MONGOOSE_REPLICA_STRING or ''
|
||||
readpref: process.env.COCO_MONGO_READPREF or 'primary'
|
||||
|
||||
if process.env.COCO_MONGO_ANALYTICS_REPLICA_STRING?
|
||||
config.mongo.analytics_replica_string = process.env.COCO_MONGO_ANALYTICS_REPLICA_STRING
|
||||
else
|
||||
config.mongo.analytics_replica_string = "mongodb://#{config.mongo.analytics_host}:#{config.mongo.analytics_port}/#{config.mongo.analytics_db}"
|
||||
|
||||
if process.env.COCO_MONGO_LS_REPLICA_STRING?
|
||||
config.mongo.level_session_replica_string = process.env.COCO_MONGO_LS_REPLICA_STRING
|
||||
|
||||
|
|
Loading…
Reference in a new issue