Skip to content

Commit

Permalink
Pass timeout parameter to request.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Joey Hartley committed Jul 20, 2020
1 parent 9cf6450 commit 2443921
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ function getErrorMessages(responseBody) {
}
}
class Client {
constructor(apiKey, baseUrl) {
constructor(apiKey, baseUrl, timeout) {
this.apiKey = apiKey
this.clientName = 'elastic-app-search-node'
this.clientVersion = packageJson.version
this.baseUrl = baseUrl
this.timeout = timeout
}

get(path, params) {
Expand Down Expand Up @@ -74,6 +75,7 @@ class Client {
method: method,
url: `${this.baseUrl}${path}`,
json: params,
timeout: this.timeout,
auth: {
bearer: this.apiKey
},
Expand Down

0 comments on commit 2443921

Please sign in to comment.