Skip to content

Commit

Permalink
Fix #136 (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
sitingren authored Mar 5, 2024
1 parent e2ee7df commit bc01199
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
28 changes: 24 additions & 4 deletions packages/vertica-nodejs/lib/connection-parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,32 @@ class ConnectionParameters {
this.workload = val('workload', config, false)

// client auditing information
this.client_os_hostname = os.hostname()
this.client_type = "Node.js Driver"
this.client_version = "1.1.2"
this.client_pid = process.pid.toString()
this.client_os = os.platform()
this.client_os_user_name = os.userInfo().username

try {
this.client_os_hostname = os.hostname()
} catch (e) {
this.client_os_hostname = ""
}

try {
this.client_pid = process.pid.toString()
} catch (e) {
this.client_pid = "0"
}

try {
this.client_os = os.platform()
} catch (e) {
this.client_os = ""
}

try {
this.client_os_user_name = os.userInfo().username
} catch (e) {
this.client_os_user_name = ""
}

//NOTE: The client has only been tested to support 3.5, which was chosen in order to include SHA512 support
this.protocol_version = (3 << 16 | 5) // 3.5 -> (major << 16 | minor) -> (3 << 16 | 5) -> 196613
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ suite.test('successful connection', (done) => {
})

suite.test('expired connection timeout', (done) => {
const opts = { ...options, port: 54322 }
const opts = { ...options, port: 5434 }
serverWithConnectionTimeout(opts.port, opts.connectionTimeoutMillis * 2, (closeServer) => {
const timeoutId = setTimeout(() => {
throw new Error('Client should have emitted an error but it did not.')
Expand Down

0 comments on commit bc01199

Please sign in to comment.