mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Mongoose 5 (#9870)
* mongoose 5: remove unused autoinc, remove promise option (it uses native promises now) * remove mongodb package * remove mongoskin * migrate migration away from mongoskin * fix mongoose hooks * fix _updateUserWithRetries * try without next * remove init * update sinon * fix some integration tests * fix remaining tests * fix error message * fix error message * fix error message * another fix * fix mongoose options * remove greenkeeper exception
This commit is contained in:
committed by
Sabe Jones
parent
f9a47b1420
commit
1332fd68b0
@@ -1,20 +1,15 @@
|
||||
import nconf from 'nconf';
|
||||
import logger from './logger';
|
||||
import mongoose from 'mongoose';
|
||||
import Bluebird from 'bluebird';
|
||||
|
||||
const IS_PROD = nconf.get('IS_PROD');
|
||||
const MAINTENANCE_MODE = nconf.get('MAINTENANCE_MODE');
|
||||
|
||||
// Use Q promises instead of mpromise in mongoose
|
||||
mongoose.Promise = Bluebird;
|
||||
|
||||
// Do not connect to MongoDB when in maintenance mode
|
||||
if (MAINTENANCE_MODE !== 'true') {
|
||||
const mongooseOptions = !IS_PROD ? {} : {
|
||||
keepAlive: 120,
|
||||
connectTimeoutMS: 30000,
|
||||
useMongoClient: true,
|
||||
};
|
||||
|
||||
const NODE_DB_URI = nconf.get('IS_TEST') ? nconf.get('TEST_DB_URI') : nconf.get('NODE_DB_URI');
|
||||
|
||||
Reference in New Issue
Block a user