many important fixes

This commit is contained in:
2020-02-29 11:43:00 -05:00
parent 2149345d3d
commit 73c207c324
28 changed files with 1463 additions and 242 deletions
+4 -3
View File
@@ -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