rails_failover 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +8 -5
- data/CHANGELOG.md +6 -1
- data/lib/rails_failover/active_record/railtie.rb +8 -8
- data/lib/rails_failover/version.rb +1 -1
- data/makefile +1 -1
- data/rails_failover.gemspec +2 -2
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 696636b3992c9893a48a23366f760af354c496bbd1573754bdd92b66fc9913ff
|
4
|
+
data.tar.gz: 8994846710a6765afffc3a60845bc696efb53e44d532a04092d3a6ba87adf4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe74527339c42947a6205a231f6035af8e039809db86df7d64edb34d02d3cf59fa4f814b05e28f077dd89a61448b5fcde1d70094a5f6c90c81d31cb73d4bd059
|
7
|
+
data.tar.gz: f3a8df28c08ddd305833f1c3ad630c8c3f270bb398aa6698e39b74a413ba03c03614986e3da944e061547d8d70c764b92c90767b2e1bec045a1661cd941563a5
|
data/.github/workflows/ci.yml
CHANGED
@@ -35,7 +35,7 @@ jobs:
|
|
35
35
|
strategy:
|
36
36
|
fail-fast: false
|
37
37
|
matrix:
|
38
|
-
ruby: ['3.
|
38
|
+
ruby: ['3.4', '3.3', '3.2', '3.1']
|
39
39
|
|
40
40
|
steps:
|
41
41
|
- uses: actions/checkout@v3
|
@@ -59,13 +59,16 @@ jobs:
|
|
59
59
|
strategy:
|
60
60
|
fail-fast: false
|
61
61
|
matrix:
|
62
|
-
ruby: ['3.
|
63
|
-
rails: ['7.0.0']
|
62
|
+
ruby: ['3.4', '3.3', '3.2', '3.1']
|
63
|
+
rails: ['7.1.0', '7.0.0']
|
64
64
|
include:
|
65
65
|
- ruby: '3.2'
|
66
66
|
rails: '6.1.0'
|
67
|
-
|
68
|
-
|
67
|
+
exclude:
|
68
|
+
- ruby: '3.4'
|
69
|
+
rails: '7.0.0'
|
70
|
+
- ruby: '3.3'
|
71
|
+
rails: '7.0.0'
|
69
72
|
|
70
73
|
steps:
|
71
74
|
- uses: actions/checkout@v3
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
## [
|
8
|
+
## [2.1.0] - 2024-05-29
|
9
|
+
- DEV: Update dependencies to officially support Rails 7.1
|
10
|
+
|
11
|
+
## [2.0.1] - 2023-05-30
|
12
|
+
|
13
|
+
- FIX: Use `next` instead of `break` to avoid a local jump error
|
9
14
|
|
10
15
|
## [2.0.0] - 2023-05-16
|
11
16
|
|
@@ -6,7 +6,7 @@ module RailsFailover
|
|
6
6
|
initializer "rails_failover.init", after: "active_record.initialize_database" do |app|
|
7
7
|
app.config.active_record_rails_failover = false
|
8
8
|
config = RailsFailover::ActiveRecord.config
|
9
|
-
|
9
|
+
next unless config[:replica_host] && config[:replica_port]
|
10
10
|
|
11
11
|
app.config.active_record_rails_failover = true
|
12
12
|
::ActiveSupport.on_load(:active_record) do
|
@@ -21,14 +21,14 @@ module RailsFailover
|
|
21
21
|
end
|
22
22
|
|
23
23
|
initializer "rails_failover.insert_middleware" do |app|
|
24
|
-
|
25
|
-
ActionDispatch::DebugExceptions.register_interceptor do |request, exception|
|
26
|
-
RailsFailover::ActiveRecord::Interceptor.handle(request, exception)
|
27
|
-
end
|
24
|
+
next unless app.config.active_record_rails_failover
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
ActionDispatch::DebugExceptions.register_interceptor do |request, exception|
|
27
|
+
RailsFailover::ActiveRecord::Interceptor.handle(request, exception)
|
28
|
+
end
|
29
|
+
|
30
|
+
if !skip_middleware?(app.config)
|
31
|
+
app.middleware.unshift(RailsFailover::ActiveRecord::Middleware)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
data/makefile
CHANGED
@@ -9,7 +9,7 @@ test_active_record:
|
|
9
9
|
@ACTIVE_RECORD=1 bundle exec rspec --tag type:active_record ${RSPEC_PATH}
|
10
10
|
|
11
11
|
setup_dummy_rails_server:
|
12
|
-
@cd spec/support/dummy_app && BUNDLE_GEMFILE=Gemfile bundle install --quiet &&
|
12
|
+
@cd spec/support/dummy_app && BUNDLE_GEMFILE=Gemfile bundle install --quiet && BUNDLE_GEMFILE=Gemfile RAILS_ENV=production $(BUNDLER_BIN) exec rails db:create db:migrate db:seed
|
13
13
|
|
14
14
|
start_dummy_rails_server:
|
15
15
|
@cd spec/support/dummy_app && BUNDLE_GEMFILE=Gemfile SECRET_KEY_BASE=somekey bundle exec unicorn -c config/unicorn.conf.rb -D -E production
|
data/rails_failover.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_dependency "activerecord", ">= 6.1", "
|
27
|
-
spec.add_dependency "railties", ">= 6.1", "
|
26
|
+
spec.add_dependency "activerecord", ">= 6.1", "< 8.0"
|
27
|
+
spec.add_dependency "railties", ">= 6.1", "< 8.0"
|
28
28
|
spec.add_dependency "concurrent-ruby"
|
29
29
|
|
30
30
|
spec.add_development_dependency "rake", "~> 12.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_failover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Tan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -17,9 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '6.1'
|
20
|
-
- - "
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +27,9 @@ dependencies:
|
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '6.1'
|
30
|
-
- - "
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: railties
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -37,9 +37,9 @@ dependencies:
|
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '6.1'
|
40
|
-
- - "
|
40
|
+
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '8.0'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -47,9 +47,9 @@ dependencies:
|
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '6.1'
|
50
|
-
- - "
|
50
|
+
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '8.0'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: concurrent-ruby
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,7 +190,7 @@ dependencies:
|
|
190
190
|
- - ">="
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
|
-
description:
|
193
|
+
description:
|
194
194
|
email:
|
195
195
|
- tgx@discourse.org
|
196
196
|
executables: []
|
@@ -229,7 +229,7 @@ homepage: https://github.com/discourse/rails_failover
|
|
229
229
|
licenses:
|
230
230
|
- MIT
|
231
231
|
metadata: {}
|
232
|
-
post_install_message:
|
232
|
+
post_install_message:
|
233
233
|
rdoc_options: []
|
234
234
|
require_paths:
|
235
235
|
- lib
|
@@ -244,8 +244,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
|
-
rubygems_version: 3.
|
248
|
-
signing_key:
|
247
|
+
rubygems_version: 3.5.9
|
248
|
+
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Failover for ActiveRecord and Redis
|
251
251
|
test_files: []
|