Skip to content

Commit

Permalink
Do not initialize InfluxDB when there is no host
Browse files Browse the repository at this point in the history
The empty array also defaults to localhost.

Fix #6556.
  • Loading branch information
ChrisBr committed Dec 11, 2018
1 parent e6fb2f5 commit 343f919
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/config/initializers/influxdb_rails.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
return if CONFIG['influxdb_hosts'].blank? # defaults to localhost otherwise

InfluxDB::Rails.configure do |config|
config.influxdb_database = CONFIG['influxdb_database']
config.influxdb_username = CONFIG['influxdb_username']
config.influxdb_password = CONFIG['influxdb_password']
config.influxdb_hosts = CONFIG['influxdb_hosts'] || [] # default is otherwise localhost
config.influxdb_hosts = CONFIG['influxdb_hosts']
config.influxdb_port = CONFIG['influxdb_port']
config.retry = CONFIG['influxdb_retry']
config.use_ssl = CONFIG['influxdb_ssl']
Expand Down

0 comments on commit 343f919

Please sign in to comment.