Skip to content

Commit

Permalink
Remove disable_switcher flag
Browse files Browse the repository at this point in the history
  • Loading branch information
perryism committed Jan 27, 2018
1 parent 122b5ff commit f3f7eef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions lib/lhm/entangler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ class Entangler
include Command
include SqlHelper

attr_reader :connection, :delete_trigger_after
attr_reader :connection

# Creates entanglement between two tables. All creates, updates and deletes
# to origin will be repeated on the destination table.
def initialize(migration, connection = nil, delete_trigger_after = true)
def initialize(migration, connection = nil)
@intersection = migration.intersection
@origin = migration.origin
@destination = migration.destination
@connection = connection
@delete_trigger_after = delete_trigger_after
end

def entangle
Expand Down Expand Up @@ -86,7 +85,6 @@ def before
end

def after
return unless @delete_trigger_after
untangle.each do |stmt|
@connection.execute(tagged(stmt))
end
Expand Down
10 changes: 3 additions & 7 deletions lib/lhm/invoker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@ def run(options = {})

Entangler.new(migration, @connection, options[:delete_trigger_after] && true).run do
Chunker.new(migration, @connection, options).run
if options[:disable_switcher]
Lhm.logger.debug 'switcher is disabled'
if options[:atomic_switch]
AtomicSwitcher.new(migration, @connection).run
else
if options[:atomic_switch]
AtomicSwitcher.new(migration, @connection).run
else
LockedSwitcher.new(migration, @connection).run
end
LockedSwitcher.new(migration, @connection).run
end
end
end
Expand Down

0 comments on commit f3f7eef

Please sign in to comment.