Module: Octopus::Migration::ClassMethods
- Defined in:
- lib/octopus/migration.rb
Instance Method Summary collapse
Instance Method Details
#shards ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/octopus/migration.rb', line 44 def shards shards = Set.new if (groups = (current_group_specified ? current_group : Octopus.config[:default_migration_group])) Array.wrap(groups).each do |group| group_shards = connection.shards_for_group(group) shards.merge(group_shards) if group_shards end elsif (shard = current_shard) shards.merge(Array.wrap(shard)) end shards.to_a.presence || [Octopus.master_shard] end |