mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Setting up read preferences and china specific configuration
This commit is contained in:
parent
aae44c2064
commit
7f9301e8c6
9 changed files with 12 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
|||
mongoose = require 'mongoose'
|
||||
plugins = require '../plugins/plugins'
|
||||
|
||||
ArticleSchema = new mongoose.Schema(body: String, {strict: false})
|
||||
ArticleSchema = new mongoose.Schema(body: String, {strict: false,read:'nearest'})
|
||||
|
||||
ArticleSchema.index(
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ mongoose = require 'mongoose'
|
|||
plugins = require '../plugins/plugins'
|
||||
log = require 'winston'
|
||||
|
||||
CampaignSchema = new mongoose.Schema(body: String, {strict: false})
|
||||
CampaignSchema = new mongoose.Schema(body: String, {strict: false,read:'nearest'})
|
||||
|
||||
CampaignSchema.index({i18nCoverage: 1}, {name: 'translation coverage index', sparse: true})
|
||||
CampaignSchema.index({slug: 1}, {name: 'slug index', sparse: true, unique: true})
|
||||
|
|
|
@ -21,7 +21,9 @@ module.exports.connect = () ->
|
|||
mongooseCache.install(mongoose, {max: 200, maxAge: 1 * 60 * 1000, debug: false}, Aggregate)
|
||||
|
||||
module.exports.generateMongoConnectionString = ->
|
||||
if not testing and config.mongo.mongoose_replica_string
|
||||
if not testing and config.tokyo
|
||||
address = config.mongo.mongoose_tokyo_replica_string
|
||||
else if not testing and config.mongo.mongoose_replica_string
|
||||
address = config.mongo.mongoose_replica_string
|
||||
else
|
||||
dbName = config.mongo.db
|
||||
|
|
|
@ -4,7 +4,7 @@ jsonschema = require '../../app/schemas/models/level'
|
|||
|
||||
LevelSchema = new mongoose.Schema({
|
||||
description: String
|
||||
}, {strict: false})
|
||||
}, {strict: false, read:'nearest'})
|
||||
|
||||
LevelSchema.index(
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ jsonschema = require '../../../app/schemas/models/level_component'
|
|||
LevelComponentSchema = new mongoose.Schema {
|
||||
description: String
|
||||
system: String
|
||||
}, {strict: false}
|
||||
}, {strict: false, read:'nearest'}
|
||||
|
||||
LevelComponentSchema.index(
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ LevelSessionSchema = new mongoose.Schema({
|
|||
created:
|
||||
type: Date
|
||||
'default': Date.now
|
||||
}, {strict: false})
|
||||
}, {strict: false,read:'nearest'})
|
||||
|
||||
LevelSessionSchema.index({creator: 1})
|
||||
LevelSessionSchema.index({level: 1})
|
||||
|
|
|
@ -4,7 +4,7 @@ jsonschema = require '../../../app/schemas/models/level_system'
|
|||
|
||||
LevelSystemSchema = new mongoose.Schema {
|
||||
description: String
|
||||
}, {strict: false}
|
||||
}, {strict: false,read:'nearest'}
|
||||
|
||||
LevelSystemSchema.index(
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ plugins = require '../../plugins/plugins'
|
|||
|
||||
ThangTypeSchema = new mongoose.Schema({
|
||||
body: String,
|
||||
}, {strict: false})
|
||||
}, {strict: false,read:'nearest'})
|
||||
|
||||
ThangTypeSchema.index(
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@ config = {}
|
|||
|
||||
config.unittest = process.argv.indexOf('--unittest') > -1
|
||||
|
||||
config.tokyo = process.env.TOKYO or false
|
||||
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
|
||||
config.cloudflare =
|
||||
|
@ -16,6 +17,7 @@ config.mongo =
|
|||
host: process.env.COCO_MONGO_HOST or 'localhost'
|
||||
db: process.env.COCO_MONGO_DATABASE_NAME or 'coco'
|
||||
mongoose_replica_string: process.env.COCO_MONGO_MONGOOSE_REPLICA_STRING or ''
|
||||
mongoose_tokyo_replica_string: process.env.COCO_MONGO_MONGOOSE_TOKYO_REPLICA_STRING or ''
|
||||
|
||||
config.apple =
|
||||
verifyURL: process.env.COCO_APPLE_VERIFY_URL or 'https://sandbox.itunes.apple.com/verifyReceipt'
|
||||
|
|
Loading…
Reference in a new issue