switchman 1.5.17 → 1.5.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/switchman/engine.rb +3 -0
- data/lib/switchman/standard_error.rb +12 -0
- data/lib/switchman/version.rb +1 -1
- data/lib/tasks/switchman.rake +13 -8
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72cd0fd10611a4acc7c12f46ca25435689d9f3ea
|
4
|
+
data.tar.gz: 80a15da1b891e2945bf6c2ceb80c0bd95693d63f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 819f32885454df751e646e995b859b8ceb5549bb74f7f8e8dd4a0445c5423cb25ffccbf8dc84da32304f299e619469e9c1540af66537952751d5b3e31ee09384
|
7
|
+
data.tar.gz: a727cc6b22e0fb123adaf6514ccba6eb1330d9fa96e0410280bb063132852738f9dfe4d198caf271651ea4f0d6f7a1b0b23d20e7c5ec157e790cc6e59d484dba
|
data/lib/switchman/engine.rb
CHANGED
@@ -86,6 +86,9 @@ module Switchman
|
|
86
86
|
require "switchman/rails"
|
87
87
|
require "switchman/shackles/relation"
|
88
88
|
require "switchman/shard_internal"
|
89
|
+
require "switchman/standard_error"
|
90
|
+
|
91
|
+
::StandardError.include(StandardError)
|
89
92
|
|
90
93
|
include ActiveRecord::Base
|
91
94
|
include ActiveRecord::AttributeMethods
|
data/lib/switchman/version.rb
CHANGED
data/lib/tasks/switchman.rake
CHANGED
@@ -56,15 +56,20 @@ module Switchman
|
|
56
56
|
end
|
57
57
|
|
58
58
|
::Shackles.activate(:deploy) do
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
59
|
+
begin
|
60
|
+
Shard.with_each_shard(scope, Shard.categories, options) do
|
61
|
+
shard = Shard.current
|
62
|
+
puts "#{shard.id}: #{shard.description}"
|
63
|
+
::ActiveRecord::Base.connection_pool.spec.config[:shard_name] = Shard.current.name
|
64
|
+
::ActiveRecord::Base.configurations[::Rails.env] = ::ActiveRecord::Base.connection_pool.spec.config.stringify_keys
|
65
|
+
shard.database_server.unshackle do
|
66
|
+
old_actions.each { |action| action.call(*task_args) }
|
67
|
+
end
|
68
|
+
nil
|
66
69
|
end
|
67
|
-
|
70
|
+
rescue => e
|
71
|
+
puts "Exception from #{e.current_shard.id}: #{e.current_shard.description}" if options[:parallel] != 0
|
72
|
+
raise
|
68
73
|
end
|
69
74
|
end
|
70
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- lib/switchman/shackles.rb
|
203
203
|
- lib/switchman/shackles/relation.rb
|
204
204
|
- lib/switchman/sharded_instrumenter.rb
|
205
|
+
- lib/switchman/standard_error.rb
|
205
206
|
- lib/switchman/test_helper.rb
|
206
207
|
- lib/switchman/version.rb
|
207
208
|
- lib/tasks/switchman.rake
|