Skip to content

Commit

Permalink
fix(install): elasticsearch failing #192
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed May 6, 2019
1 parent 4badd1a commit 1a3fe15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/controllers/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ installController.install = function (req, res) {
)
},
function (done) {
if (!eHost) return done()
SettingsSchema.create(
{
name: 'es:host',
Expand All @@ -194,6 +195,7 @@ installController.install = function (req, res) {
)
},
function (done) {
if (!ePort) return done()
SettingsSchema.create(
{
name: 'es:port',
Expand Down
20 changes: 10 additions & 10 deletions src/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ function checkConnection (callback) {
)
}

// ES.testConnection = function (callback) {
// if (process.env.ELATICSEARCH_URI) ES.host = process.env.ELATICSEARCH_URI
// else ES.host = nconf.get('elasticsearch:host') + ':' + nconf.get('elasticsearch:port')
//
// ES.esclient = new elasticsearch.Client({
// host: ES.host
// })
//
// checkConnection(callback)
// }
ES.testConnection = function (callback) {
if (process.env.ELATICSEARCH_URI) ES.host = process.env.ELATICSEARCH_URI
else ES.host = nconf.get('elasticsearch:host') + ':' + nconf.get('elasticsearch:port')

ES.esclient = new elasticsearch.Client({
host: ES.host
})

checkConnection(callback)
}

ES.setupHooks = function () {
var ticketSchema = require('../models/ticket')
Expand Down

0 comments on commit 1a3fe15

Please sign in to comment.