fix(promise): make sure every promise is handled

This commit is contained in:
Matteo Pagliazzi
2020-03-20 20:07:13 +01:00
parent de37eb1bb2
commit ae7df804cb
5 changed files with 20 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import mongoose from 'mongoose';
import logger from '../../libs/logger';
import schema from './schema'; // eslint-disable-line import/no-cycle
import './hooks'; // eslint-disable-line import/no-cycle
@@ -32,4 +33,5 @@ mongoose.model('User')
.then(foundMods => {
// Using push to maintain the reference to mods
mods.push(...foundMods);
});
})
.catch(err => logger.error(err));