From 17e6a95390ce5f5b62d4fc5cbe3a7fde87656bcc Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 23 Jun 2014 15:32:13 +0200 Subject: initial take on replication --- lib/tapicero/user_database.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/tapicero/user_database.rb') diff --git a/lib/tapicero/user_database.rb b/lib/tapicero/user_database.rb index f04e3e7..4061292 100644 --- a/lib/tapicero/user_database.rb +++ b/lib/tapicero/user_database.rb @@ -24,6 +24,16 @@ module Tapicero end end + def replicate() + return unless config.options[:mode] == 'mirror' + replication = config.options[:replication] + replication[:masters].each do |key, node| + retry_request_once "Replicating" do + Replication.new(source, name).run continuous: true + end + end + end + def add_design_docs pattern = BASE_DIR + 'designs' + '*.json' Tapicero.logger.debug "Looking for design docs in #{pattern}" -- cgit v1.2.3