mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-08-16 07:28:40 +02:00
27 lines
640 B
JavaScript
27 lines
640 B
JavaScript
var common = require('../../common');
|
|
var assert = require('assert');
|
|
var pool = common.createPool({
|
|
connectionLimit : 1,
|
|
waitForConnections : false
|
|
});
|
|
|
|
pool.getConnection(function(err, connection) {
|
|
if (err) throw err;
|
|
pool.getConnection(function(err) {
|
|
assert.ok(err);
|
|
|
|
var shouldGetConnection = false;
|
|
pool.config.waitForConnections = true;
|
|
pool.getConnection(function(err, connection2) {
|
|
if (err) throw err;
|
|
assert.ok(shouldGetConnection);
|
|
assert.strictEqual(connection, connection2);
|
|
|
|
pool.end();
|
|
});
|
|
|
|
shouldGetConnection = true;
|
|
connection.release();
|
|
});
|
|
});
|