lib/tasks/switchman.rake in switchman-1.2.11 vs lib/tasks/switchman.rake in switchman-1.2.12
- old
+ new
@@ -62,9 +62,11 @@
shards ||= scope
Shard.with_each_shard(shards, Shard.categories, :parallel => ENV['PARALLEL'].to_i) do
shard = Shard.current
puts "#{shard.id}: #{shard.description}"
+ ::ActiveRecord::Base.connection_pool.spec.config[:shard_name] = Shard.current.name
+ ::ActiveRecord::Base.configurations[::Rails.env] = ::ActiveRecord::Base.connection_pool.spec.config.stringify_keys
shard.database_server.unshackle do
old_actions.each(&:call)
end
nil
end