mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-15 06:56:57 +00:00
added default mongoose connection
This commit is contained in:
parent
7fd29b18a8
commit
e6a670533d
1 changed files with 16 additions and 0 deletions
16
services/web/app/coffee/infrastructure/Mongoose.coffee
Normal file
16
services/web/app/coffee/infrastructure/Mongoose.coffee
Normal file
|
@ -0,0 +1,16 @@
|
|||
mongoose = require('mongoose')
|
||||
Settings = require 'settings-sharelatex'
|
||||
logger = require('logger-sharelatex')
|
||||
|
||||
mongoose.connect(Settings.mongo.url, server: poolSize: 10)
|
||||
|
||||
mongoose.connection.on 'connected', () ->
|
||||
logger.log {url:Settings.mongo.url}, 'mongoose default connection open'
|
||||
|
||||
mongoose.connection.on 'error', (err) ->
|
||||
logger.err err:err, 'mongoose error on default connection';
|
||||
|
||||
mongoose.connection.on 'disconnected', () ->
|
||||
logger.log 'mongoose default connection disconnected'
|
||||
|
||||
module.exports = mongoose
|
Loading…
Add table
Reference in a new issue