redis 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10ad63f47810f1479a1b36fa446a48220570841059a262d803bd837834f25f15
4
- data.tar.gz: 78bf177db823e73c022d56f1582b2043155ff4ba0171c7e8857114689f34336a
3
+ metadata.gz: 15a91a0ef8a3f697bc35cb5c4029d979134b58984b7c23deee36707cfc081a32
4
+ data.tar.gz: 9cdb4881111253801c3f1ad5a4f5fafa38b14b384ba595bbc422fa899d006619
5
5
  SHA512:
6
- metadata.gz: 17705fee83bdf111cc886b96cd499d9244b126b3676d46422964a927cf2bbbbb297cd349a881fb1dc70dc7033e96a50308825e1f6b6ef23b17ba34a3f3288548
7
- data.tar.gz: 5601c8ac88f83f5b178114985ef0719ff94514e265c85542f1a1269000261608dae3a9c4c63ba90263eb2c48df20f13fdb035fdf83e9e011b0fbba7ea818d774
6
+ metadata.gz: 69731342edc1c5d5b26ce18deecac7c3b4d1a2b452272df977ae3ccb5cd5812174ebdbb1a78b19e96d6ccf8e45a0256e46a927ad1a2a7a9577c08eb35055e800
7
+ data.tar.gz: f9994ab4b694c99862ba932795c842c5fa24d72790ee44e908162e144608c481f2052aa2af6cca42d173b77af3e8a5a9d90dffcaf828f3a818dc1196fe4aa590
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 5.0.2
4
+
5
+ - Fix `Redis#close` to properly reset the fork protection check.
6
+
3
7
  # 5.0.1
4
8
 
5
9
  - Added a fake `Redis::Connections.drivers` method to be compatible with older sidekiq versions.
data/lib/redis/client.rb CHANGED
@@ -30,7 +30,7 @@ class Redis
30
30
  def initialize(*)
31
31
  super
32
32
  @inherit_socket = false
33
- @pid = Process.pid
33
+ @pid = nil
34
34
  end
35
35
  ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
36
36
 
@@ -114,10 +114,15 @@ class Redis
114
114
  @inherit_socket = true
115
115
  end
116
116
 
117
+ def close
118
+ super
119
+ @pid = nil
120
+ end
121
+
117
122
  private
118
123
 
119
124
  def ensure_connected(retryable: true)
120
- unless @inherit_socket || Process.pid == @pid
125
+ unless @inherit_socket || (@pid ||= Process.pid) == Process.pid
121
126
  raise InheritedError,
122
127
  "Tried to use a connection from a child process without reconnecting. " \
123
128
  "You need to reconnect to Redis after forking " \
@@ -36,7 +36,7 @@ class Redis
36
36
  #
37
37
  # @param [String, Symbol] subcommand e.g. `kill`, `list`, `getname`, `setname`
38
38
  # @return [String, Hash] depends on subcommand
39
- def client(subcommand = nil, *args)
39
+ def client(subcommand, *args)
40
40
  send_command([:client, subcommand] + args) do |reply|
41
41
  if subcommand.to_s == "list"
42
42
  reply.lines.map do |line|
data/lib/redis/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Redis
4
- VERSION = '5.0.1'
4
+ VERSION = '5.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2022-08-29 00:00:00.000000000 Z
19
+ date: 2022-08-31 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: redis-client
@@ -75,9 +75,9 @@ licenses:
75
75
  metadata:
76
76
  bug_tracker_uri: https://github.com/redis/redis-rb/issues
77
77
  changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
78
- documentation_uri: https://www.rubydoc.info/gems/redis/5.0.1
78
+ documentation_uri: https://www.rubydoc.info/gems/redis/5.0.2
79
79
  homepage_uri: https://github.com/redis/redis-rb
80
- source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.1
80
+ source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.2
81
81
  post_install_message:
82
82
  rdoc_options: []
83
83
  require_paths: