Skip to content

Commit

Permalink
Update apollo.js
Browse files Browse the repository at this point in the history
Create shallow copy of elasticsearch config to prevent:
Unhandled rejection Error: Do not reuse objects to configure the elasticsearch Client class: elastic/elasticsearch-js#33
    at new Client (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\elasticsearch\src\lib\client.js:38:11)
    at Object.create_es_client (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:111:22)
    at Object._assert_es_index (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:116:25)
    at Object.tryCatcher (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\bluebird\js\release\util.js:16:23)
    at Object.ret [as assertESIndexAsync] (eval at makeNodePromisifiedEval (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39)
    at Object.onUserDefinedAggregates (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:407:37)
    at Object._assert_user_defined_aggregates (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:318:7)
    at Object.f (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:426:14)
    at Object._assert_user_defined_functions (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:253:7)
    at Object.f (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:438:14)
    at Object._assert_user_defined_types (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:201:7)
    at Object.f (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:451:14)
    at C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\express-cassandra\lib\orm\apollo.js:190:9
    at HostConnectionPool.next (C:\Users\mtsaren\Documents\GitHub\facenet\server\node\node_modules\cassandra-driver\lib\utils.js:503:5)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
  • Loading branch information
maxts authored Sep 19, 2019
1 parent eed715d commit fdab78d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/orm/apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Apollo.prototype = {
defaultHosts.push({ host });
});

const esClientConfig = _.defaults(this._connection.elasticsearch, {
const esClientConfig = _.defaults(Object.assign({}, this._connection.elasticsearch), {
hosts: defaultHosts,
sniffOnStart: true,
});
Expand Down

0 comments on commit fdab78d

Please sign in to comment.