Set up the connected handler before connect
This commit is contained in:
parent
589908a78f
commit
3613f6e22f
|
@ -258,13 +258,12 @@ AbstractClass.create = function (data, callback) {
|
|||
|
||||
function stillConnecting(schema, obj, args) {
|
||||
if (schema.connected) return false;
|
||||
if (!schema.connecting) {
|
||||
schema.connect();
|
||||
}
|
||||
if (schema.connecting) return true;
|
||||
var method = args.callee;
|
||||
schema.on('connected', function () {
|
||||
method.apply(obj, [].slice.call(args));
|
||||
});
|
||||
schema.connect();
|
||||
return true;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue