Replace couchbase counters with drb version

This commit is contained in:
2014-08-05 17:49:16 +02:00
parent c0c25673bf
commit 99a9536c68
20 changed files with 400 additions and 282 deletions
+7
View File
@@ -5,13 +5,20 @@ module Qwaiter
end
def self.load_design_docs!
return unless connection.present?
Dir.glob(Rails.root.join('config/couchbase/design_docs', "*.json")).each do |design_doc|
connection.save_design_doc File.open(design_doc)
end
end
def self.design_doc(name)
return unless connection.present?
connection.design_docs[name]
end
def self.flush_counters!
return unless connection.present?
design_doc('supplier').counters(reduce: false).each{|counter| Qwaiter::Counter.set counter.key, 0}
end
end
end
-5
View File
@@ -22,8 +22,3 @@ module Qwaiter
end
end
end
# use the connection from couchbase-structures/documents
# will be overwritten in the specs since flushing the real
# thing is difficult
Qwaiter::Counter.connection = $cb unless Rails.env.test?
+8
View File
@@ -0,0 +1,8 @@
module Qwaiter
module DrbCounter
def self.object
require 'drb'
DRbObject.new_with_uri('druby://localhost:9022')
end
end
end