modis 4.3.0 → 4.3.1
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/.github_changelog_generator +1 -1
- data/CHANGELOG.md +14 -2
- data/Gemfile.lock +1 -1
- data/lib/modis/configuration.rb +3 -3
- data/lib/modis/version.rb +1 -1
- data/lib/modis.rb +19 -3
- data/spec/multi_redis_spec.rb +2 -0
- data/spec/spec_helper.rb +3 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4490e45322b9ae24bb78a01190616971ff18fd0ee14030493a2cb76f1496d8ac
|
4
|
+
data.tar.gz: 135acda908b954b448aff439a4fd6663f06297da29b7bc8ce936c2f153696e05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 656b9746bb1381ae3eee2cec837e3a1adebcd505eea7cb3289f660d8bfa17371e4defabb567898000b4e1a5a49775205deff1081a00299422e125360a3a186b2
|
7
|
+
data.tar.gz: 49c2d453ca3079306ee51fc9d97bda1330d10871a205a57b22ca70260dc746b8d8c589fc66750bb09b8af7aa6421faf8fa1e3fb79ae2035411c32033fd328bb3
|
data/.github_changelog_generator
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [v4.1
|
3
|
+
## [v4.3.1](https://github.com/rpush/modis/tree/v4.3.1) (2024-08-01)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/rpush/modis/compare/v4.
|
5
|
+
[Full Changelog](https://github.com/rpush/modis/compare/v4.3.0...v4.3.1)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Release 4.3.0 breaks the Rpush initialization [\#50](https://github.com/rpush/modis/issues/50)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Restore backwards compatibility broken in 4.3.0 [\#51](https://github.com/rpush/modis/pull/51) ([benlangfeld](https://github.com/benlangfeld))
|
14
|
+
|
15
|
+
## [v4.3.0](https://github.com/rpush/modis/tree/v4.3.0) (2024-07-31)
|
16
|
+
|
17
|
+
[Full Changelog](https://github.com/rpush/modis/compare/v4.2.0...v4.3.0)
|
6
18
|
|
7
19
|
**Merged pull requests:**
|
8
20
|
|
data/Gemfile.lock
CHANGED
data/lib/modis/configuration.rb
CHANGED
data/lib/modis/version.rb
CHANGED
data/lib/modis.rb
CHANGED
@@ -18,11 +18,14 @@ require 'modis/index'
|
|
18
18
|
require 'modis/model'
|
19
19
|
|
20
20
|
module Modis
|
21
|
-
@mutex = Mutex.new
|
22
21
|
class << self
|
23
22
|
attr_writer :connection_pool_size, :connection_pool_timeout,
|
24
23
|
:connection_pools
|
25
24
|
|
25
|
+
def mutex
|
26
|
+
@mutex ||= Mutex.new
|
27
|
+
end
|
28
|
+
|
26
29
|
def redis_options
|
27
30
|
@redis_options ||= { default: {} }
|
28
31
|
end
|
@@ -31,7 +34,20 @@ module Modis
|
|
31
34
|
if options.is_a?(Hash) && options.values.first.is_a?(Hash)
|
32
35
|
@redis_options = options.transform_values(&:dup)
|
33
36
|
else
|
34
|
-
|
37
|
+
redis_options[:default] = options
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def reset!
|
42
|
+
connection_pools.each do |key, _|
|
43
|
+
with_connection(key) do |connection|
|
44
|
+
keys = connection.keys "#{config.namespace}:*"
|
45
|
+
connection.del(*keys) unless keys.empty?
|
46
|
+
end
|
47
|
+
end
|
48
|
+
instance_variables.each do |var|
|
49
|
+
instance_variable_set(var, nil)
|
50
|
+
remove_instance_variable(var)
|
35
51
|
end
|
36
52
|
end
|
37
53
|
|
@@ -49,7 +65,7 @@ module Modis
|
|
49
65
|
|
50
66
|
def connection_pool(pool_name = :default)
|
51
67
|
connection_pools[pool_name] ||= begin
|
52
|
-
|
68
|
+
mutex.synchronize do
|
53
69
|
ConnectionPool.new(
|
54
70
|
size: connection_pool_size,
|
55
71
|
timeout: connection_pool_timeout
|
data/spec/multi_redis_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -14,18 +14,12 @@ require 'modis'
|
|
14
14
|
|
15
15
|
Redis.raise_deprecations = true if Gem.loaded_specs['redis'].version >= Gem::Version.new('4.6.0')
|
16
16
|
|
17
|
-
Modis.configure do |config|
|
18
|
-
config.namespace = 'modis'
|
19
|
-
end
|
20
|
-
|
21
17
|
RSpec.configure do |config|
|
22
18
|
config.after :each do
|
23
19
|
RSpec::Mocks.space.proxy_for(Modis).reset
|
24
|
-
Modis.
|
25
|
-
|
26
|
-
|
27
|
-
connection.del(*keys) unless keys.empty?
|
28
|
-
end
|
20
|
+
Modis.reset!
|
21
|
+
Modis.configure do |modis_config|
|
22
|
+
modis_config.namespace = 'modis'
|
29
23
|
end
|
30
24
|
end
|
31
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|