mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
Do not have multiple migration calls completing same callback
This commit is contained in:
parent
21e0522116
commit
ef56cba71e
@ -41,8 +41,10 @@ function removeStrategySQL (strategy) {
|
|||||||
|
|
||||||
exports.up = function (db, callback) {
|
exports.up = function (db, callback) {
|
||||||
const insertStrategies = strategies.map((s) => (cb) => {
|
const insertStrategies = strategies.map((s) => (cb) => {
|
||||||
db.runSql(insertEventsSQL(s), cb);
|
async.series([
|
||||||
db.runSql(insertStrategySQL(s), cb);
|
db.runSql.bind(db, insertEventsSQL(s)),
|
||||||
|
db.runSql.bind(db, insertStrategySQL(s)),
|
||||||
|
], cb);
|
||||||
});
|
});
|
||||||
async.series(insertStrategies, callback);
|
async.series(insertStrategies, callback);
|
||||||
};
|
};
|
||||||
@ -51,8 +53,10 @@ exports.down = function (db, callback) {
|
|||||||
const removeStrategies = strategies
|
const removeStrategies = strategies
|
||||||
.filter(s => s.name !== 'default')
|
.filter(s => s.name !== 'default')
|
||||||
.map((s) => (cb) => {
|
.map((s) => (cb) => {
|
||||||
db.runSql(removeEventsSQL(s), cb);
|
async.series([
|
||||||
db.runSql(removeStrategySQL(s), cb);
|
db.runSql.bind(db, removeEventsSQL(s)),
|
||||||
|
db.runSql.bind(db, removeStrategySQL(s)),
|
||||||
|
], cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
async.series(removeStrategies, callback);
|
async.series(removeStrategies, callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user