distribute_reads 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -1
- data/.travis.yml +2 -1
- data/CHANGELOG.md +4 -0
- data/lib/distribute_reads.rb +8 -0
- data/lib/distribute_reads/job_methods.rb +7 -1
- data/lib/distribute_reads/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6ff4bc7184278bc6c6669e532f036c74e117657510a701705b8850141f3a59ed
|
4
|
+
data.tar.gz: de8307fbf47c7660b3a7c2563f5b399cd55d4b524c23550d383073fb49df68f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9c651428a0fccf0a02f16a8d3ab587cf54f6f3f53156e89d5eea3800ca69a2228e3fdce72215526178fab80ecad3b3b8621cc381060c784ead4259910ad3f6f
|
7
|
+
data.tar.gz: 2ba6dd00743e9819a1bf5edfc35b7fdfa5d8c34a11cc4f4c563b55275fe45d4d7d0b706aa9f3b3b2516b60c98b811f81e647c318b668e67b43297f04bbdfe3fc
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
|
-
rvm: 2.
|
3
|
+
rvm: 2.5.1
|
4
4
|
script: bundle exec rake test
|
5
5
|
before_script:
|
6
6
|
- psql -c 'create database distribute_reads_test_primary;' -U postgres
|
@@ -11,3 +11,4 @@ notifications:
|
|
11
11
|
on_failure: change
|
12
12
|
gemfile:
|
13
13
|
- Gemfile
|
14
|
+
- test/gemfiles/makara3.gemfile
|
data/CHANGELOG.md
CHANGED
data/lib/distribute_reads.rb
CHANGED
@@ -69,6 +69,14 @@ module DistributeReads
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
# private
|
73
|
+
def self.makara3?
|
74
|
+
unless defined?(@makara3)
|
75
|
+
@makara3 = Gem::Version.new(Makara::VERSION.to_s) < Gem::Version.new("0.4.0")
|
76
|
+
end
|
77
|
+
@makara3
|
78
|
+
end
|
79
|
+
|
72
80
|
# legacy
|
73
81
|
def self.default_to_primary
|
74
82
|
!by_default
|
@@ -6,7 +6,13 @@ module DistributeReads
|
|
6
6
|
|
7
7
|
included do
|
8
8
|
before_perform do
|
9
|
-
|
9
|
+
if DistributeReads.by_default
|
10
|
+
if DistributeReads.makara3?
|
11
|
+
Makara::Context.set_current(Makara::Context.generate)
|
12
|
+
else
|
13
|
+
Makara::Context.release_all
|
14
|
+
end
|
15
|
+
end
|
10
16
|
end
|
11
17
|
end
|
12
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: distribute_reads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: makara
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.6
|
152
|
+
rubygems_version: 2.7.6
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Scale database reads with replicas in Rails
|