diff options
author | Christoph Helma <helma@in-silico.ch> | 2019-06-20 22:01:50 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2019-06-20 22:01:50 +0200 |
commit | 455da06aa6459da0d25b286ca6cb866ff64c4c34 (patch) | |
tree | d0ed8fcf720a02742da781669251f379b8fd07f0 /lib/lazar.rb | |
parent | 1b44e0cd76f2ead93b8b3fa0f970c85ef32a4b14 (diff) |
separate csv serialisations for batch predictions and training data, repeated measurements in mutagenicity dataset fixed, daphnia import fixed, CENTRAL_MONGO_IP removed
Diffstat (limited to 'lib/lazar.rb')
-rw-r--r-- | lib/lazar.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/lazar.rb b/lib/lazar.rb index 2a3f749..e77de9d 100644 --- a/lib/lazar.rb +++ b/lib/lazar.rb @@ -17,19 +17,22 @@ raise "Incorrect lazar environment variable LAZAR_ENV '#{ENV["LAZAR_ENV"]}', ple ENV["MONGOID_ENV"] = ENV["LAZAR_ENV"] ENV["RACK_ENV"] = ENV["LAZAR_ENV"] # should set sinatra environment +# CH: this interferes with /etc/hosts on my machine # search for a central mongo database in use # http://opentox.github.io/installation/2017/03/07/use-central-mongodb-in-docker-environment -CENTRAL_MONGO_IP = `grep -oP '^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(?=.*mongodb)' /etc/hosts`.chomp +# CENTRAL_MONGO_IP = `grep -oP '^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(?=.*mongodb)' /etc/hosts`.chomp Mongoid.load_configuration({ :clients => { :default => { :database => ENV["LAZAR_ENV"], - :hosts => (CENTRAL_MONGO_IP.blank? ? ["localhost:27017"] : ["#{CENTRAL_MONGO_IP}:27017"]), + #:hosts => (CENTRAL_MONGO_IP.blank? ? ["localhost:27017"] : ["#{CENTRAL_MONGO_IP}:27017"]), + :hosts => ["localhost:27017"] } } }) Mongoid.raise_not_found_error = false # return nil if no document is found -$mongo = Mongo::Client.new("mongodb://#{(CENTRAL_MONGO_IP.blank? ? "127.0.0.1" : CENTRAL_MONGO_IP)}:27017/#{ENV['LAZAR_ENV']}") +#$mongo = Mongo::Client.new("mongodb://#{(CENTRAL_MONGO_IP.blank? ? "127.0.0.1" : CENTRAL_MONGO_IP)}:27017/#{ENV['LAZAR_ENV']}") +$mongo = Mongo::Client.new("mongodb://127.0.0.1:27017/#{ENV['LAZAR_ENV']}") $gridfs = $mongo.database.fs # Logger setup |