[client-sync] 🎨 Remove unecessary use of PromiseUtils

Given that this packages lives inside the NylasMail app, it has access
to Bluebird Promises, which already define a .each method.

Using PromiseUtils here is unecessary
This commit is contained in:
Juan Tejada 2017-02-22 18:30:34 -08:00
parent b96300f000
commit dced0aa99e

View file

@ -1,7 +1,7 @@
const Sequelize = require('sequelize');
const fs = require('fs');
const path = require('path');
const {loadModels, PromiseUtils, HookIncrementVersionOnSave, HookTransactionLog} = require('isomorphic-core');
const {loadModels, HookIncrementVersionOnSave, HookTransactionLog} = require('isomorphic-core');
const TransactionConnector = require('./transaction-connector')
require('./database-extensions'); // Extends Sequelize on require
@ -58,7 +58,7 @@ class LocalDatabaseConnector {
// this is a bit of a hack, because sequelize.sync() doesn't work with
// schemas. It's necessary to sync models individually and in the right order.
const models = ['Contact', 'Folder', 'Label', 'Transaction', 'Thread', 'ThreadLabel', 'ThreadFolder', 'Message', 'MessageLabel', 'Reference', 'MessageReference', 'File', 'SyncbackRequest'];
return PromiseUtils.each(models, (n) =>
return Promise.each(models, (n) =>
db[n].sync()
)
});