Skip to content

Commit

Permalink
Add SyncInvoker and SyncENtangler
Browse files Browse the repository at this point in the history
  • Loading branch information
perryism committed Jan 27, 2018
1 parent d605c73 commit 1c529fb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/lhm/entangler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,10 @@ def strip(sql)
sql.strip.gsub(/\n */, "\n")
end
end

class SyncEntangler < Entangler
def after
# do nothing
end
end
end
15 changes: 15 additions & 0 deletions lib/lhm/invoker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,19 @@ def normalize_options(options)
raise
end
end

class SyncInvoker < Invoker
def run(options = {})
normalize_options(options)
set_session_lock_wait_timeouts
migration = @migrator.run

SyncEntangler.new(migration, @connection).run do
Chunker.new(migration, @connection, options).run
end
rescue => e
revert
raise
end
end
end

0 comments on commit 1c529fb

Please sign in to comment.