Run schema callback on nextTick
This commit is contained in:
parent
2e1cb45f01
commit
11171a7c7d
|
@ -1,6 +1,6 @@
|
||||||
exports.initialize = function initializeSchema(schema, callback) {
|
exports.initialize = function initializeSchema(schema, callback) {
|
||||||
schema.adapter = new Memory();
|
schema.adapter = new Memory();
|
||||||
callback();
|
process.nextTick(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
function Memory() {
|
function Memory() {
|
||||||
|
|
|
@ -27,7 +27,7 @@ exports.initialize = function initializeSchema(schema, callback) {
|
||||||
}
|
}
|
||||||
schema.client = mongoose.connect(schema.settings.url);
|
schema.client = mongoose.connect(schema.settings.url);
|
||||||
schema.adapter = new MongooseAdapter(schema.client);
|
schema.adapter = new MongooseAdapter(schema.client);
|
||||||
callback();
|
process.nextTick(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
function MongooseAdapter(client) {
|
function MongooseAdapter(client) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ exports.initialize = function initializeSchema(schema, callback) {
|
||||||
});
|
});
|
||||||
|
|
||||||
schema.adapter = new MySQL(schema.client);
|
schema.adapter = new MySQL(schema.client);
|
||||||
callback();
|
process.nextTick(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
function MySQL(client) {
|
function MySQL(client) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ var neo4j = require('./neo4j-lib');
|
||||||
exports.initialize = function initializeSchema(schema, callback) {
|
exports.initialize = function initializeSchema(schema, callback) {
|
||||||
schema.client = new neo4j.GraphDatabase(schema.settings.url);
|
schema.client = new neo4j.GraphDatabase(schema.settings.url);
|
||||||
schema.adapter = new Neo4j(schema.client);
|
schema.adapter = new Neo4j(schema.client);
|
||||||
callback();
|
process.nextTick(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
function Neo4j(client) {
|
function Neo4j(client) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ var Sequelize = require('sequelize');
|
||||||
|
|
||||||
exports.initialize = function initializeSchema(schema, callback) {
|
exports.initialize = function initializeSchema(schema, callback) {
|
||||||
schema.adapter = new SequelizeAdapter(schema);
|
schema.adapter = new SequelizeAdapter(schema);
|
||||||
callback();
|
process.nextTick(callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
function SequelizeAdapter(schema) {
|
function SequelizeAdapter(schema) {
|
||||||
|
|
Loading…
Reference in New Issue