From dced0aa99efdd1c3efa3c32958d0967d6e6b128c Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Wed, 22 Feb 2017 18:30:34 -0800 Subject: [PATCH] [client-sync] :art: 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 --- packages/client-sync/src/shared/local-database-connector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client-sync/src/shared/local-database-connector.js b/packages/client-sync/src/shared/local-database-connector.js index 6201532a7..0d60807e6 100644 --- a/packages/client-sync/src/shared/local-database-connector.js +++ b/packages/client-sync/src/shared/local-database-connector.js @@ -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() ) });