switchman 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/switchman/standard_error.rb +13 -11
- data/lib/switchman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1e19102ef71895fd381f6da856f98b71a44102fbbc08b9738f510c18fe198ed
|
4
|
+
data.tar.gz: acf67d407d42a2d32c617696f66000d358f4fbfbc7b12077e32945c07553853f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fad637185836ac6f213b6bd61870fd3390a0f10f66d74fcb0c913977e6c5d394cfee57ceab430800dc0b96a43508f131864b1aad4fb037bea861166fed30dd5
|
7
|
+
data.tar.gz: 6f3592f8ed5a920a9e556fd0a888ac59ce17ca144f85a3d78077f6a3ab036ec385f7e7070b08fd0db9de93fd54f408315837fc97e118229259e43147b017aae7
|
@@ -3,20 +3,22 @@
|
|
3
3
|
module Switchman
|
4
4
|
module StandardError
|
5
5
|
def initialize(*args)
|
6
|
-
|
7
|
-
#
|
8
|
-
if is_a?(::
|
9
|
-
|
10
|
-
return
|
11
|
-
end
|
6
|
+
super
|
7
|
+
# These seem to get themselves into a bad state if we try to lookup shards while processing
|
8
|
+
return if is_a?(IO::EAGAINWaitReadable)
|
9
|
+
return if Thread.current[:switchman_error_handler]
|
12
10
|
|
13
11
|
begin
|
14
|
-
|
15
|
-
rescue ::ActiveRecord::ConnectionNotEstablished
|
16
|
-
# If we hit an error really early in boot, activerecord may not be initialized yet
|
17
|
-
end
|
12
|
+
Thread.current[:switchman_error_handler] = true
|
18
13
|
|
19
|
-
|
14
|
+
begin
|
15
|
+
@active_shards = Shard.active_shards if defined?(Shard)
|
16
|
+
rescue
|
17
|
+
# If we hit an error really early in boot, activerecord may not be initialized yet
|
18
|
+
end
|
19
|
+
ensure
|
20
|
+
Thread.current[:switchman_error_handler] = nil
|
21
|
+
end
|
20
22
|
end
|
21
23
|
|
22
24
|
def current_shard(klass = ::ActiveRecord::Base)
|
data/lib/switchman/version.rb
CHANGED