Skip to content

Commit 08afb12

Browse files
committed
Set noDelay to true
1 parent 520bd35 commit 08afb12

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

packages/pg/lib/connection.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Connection.prototype.connect = function (port, host) {
3939
var self = this
4040

4141
this._connecting = true
42+
this.stream.setNoDelay(true)
4243
this.stream.connect(port, host)
4344

4445
this.stream.once('connect', function () {

packages/pg/test/unit/client/stream-and-query-error-interaction-tests.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var Client = require(__dirname + '/../../../lib/client')
55

66
test('emits end when not in query', function () {
77
var stream = new (require('events').EventEmitter)()
8+
stream.setNoDelay = () => {}
89
stream.connect = function () {
910
// NOOP
1011
}

packages/pg/test/unit/test-helper.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ p.connect = function () {
1717
// NOOP
1818
}
1919

20+
p.setNoDelay = () => {}
21+
2022
p.write = function (packet, cb) {
2123
this.packets.push(packet)
2224
if (cb) {

0 commit comments

Comments
 (0)