Merge pull request #2372 from overleaf/em-mongo-connection-pool
Use the default Mongoose connection pool for all models GitOrigin-RevId: d227b7eb36f130085c9eb1480dc07bd50ba57768
This commit is contained in:
committed by
sharelatex
parent
27504d7b9d
commit
bdc5360bc0
@@ -1,5 +1,4 @@
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const mongoose = require('../infrastructure/Mongoose')
|
||||
|
||||
const { Schema } = mongoose
|
||||
|
||||
@@ -7,9 +6,4 @@ const SystemMessageSchema = new Schema({
|
||||
content: { type: String, default: '' }
|
||||
})
|
||||
|
||||
const conn = mongoose.createConnection(Settings.mongo.url, {
|
||||
server: { poolSize: Settings.mongo.poolSize || 10 },
|
||||
config: { autoIndex: false }
|
||||
})
|
||||
|
||||
exports.SystemMessage = conn.model('SystemMessage', SystemMessageSchema)
|
||||
exports.SystemMessage = mongoose.model('SystemMessage', SystemMessageSchema)
|
||||
|
||||
Reference in New Issue
Block a user