lib/tasks/switchman.rake in switchman-2.2.0 vs lib/tasks/switchman.rake in switchman-2.2.1
- old
+ new
@@ -45,11 +45,11 @@
scope
end
def self.options
# we still pass through both of these options for back-compat purposes
- { parallel: ENV['PARALLEL'].to_i, max_procs: ENV['MAX_PARALLEL_PROCS'] }
+ { parallel: ENV['PARALLEL']&.to_i, max_procs: ENV['MAX_PARALLEL_PROCS']&.to_i }
end
# categories - an array or proc, to activate as the current shard during the
# task. tasks which modify the schema may want to pass all categories in
# so that schema updates for non-default tables happen against all shards.
@@ -88,10 +88,10 @@
old_actions.each { |action| action.call(*task_args) }
end
nil
end
rescue => e
- puts "Exception from #{e.current_shard.id}: #{e.current_shard.description}" if options[:parallel] != 0
+ puts "Exception from #{e.current_shard.id}: #{e.current_shard.description}" if options[:parallel].to_i != 0
raise
end
end
end
end