many important fixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
# Make drb server
|
||||
# See Dockerfile for run instructions
|
||||
require 'rubygems'
|
||||
require 'drb/drb'
|
||||
#require 'pry'
|
||||
@@ -68,7 +69,7 @@ class InMemoryQCounter
|
||||
puts "Environment: #{environment.inspect}"
|
||||
couch_settings = YAML.load_file(couch_settings_path)[environment]
|
||||
database = couch_settings['database']
|
||||
db = CouchRest.database(database)
|
||||
db = CouchRest.database(database) # for debug: db = CouchPotato.database.couchrest_database
|
||||
design_doc = "_design/order_counter"
|
||||
view_path = File.join design_doc, "_view/by_supplier_id_and_state"
|
||||
tries = 0
|
||||
@@ -105,6 +106,6 @@ class InMemoryQCounter
|
||||
end
|
||||
end
|
||||
drb_port = 9022
|
||||
environment = (%w[production staging development test] & ARGV).first || 'development'
|
||||
DRb.start_service "druby://:#{drb_port}", InMemoryQCounter.new(reload_stats: false, environment: environment)
|
||||
environment = (%w[production staging development test] & [ENV['DRB_ENV']]).first || 'development'
|
||||
DRb.start_service "druby://:#{drb_port}", InMemoryQCounter.new(reload_stats: environment == 'production', environment: environment)
|
||||
DRb.thread.join
|
||||
|
||||
Reference in New Issue
Block a user