cacheflow 0.5.0 → 0.6.0
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/CHANGELOG.md +7 -0
- data/LICENSE.txt +1 -1
- data/README.md +3 -3
- data/lib/cacheflow/memcached.rb +5 -2
- data/lib/cacheflow/redis.rb +1 -20
- data/lib/cacheflow/sidekiq.rb +8 -4
- data/lib/cacheflow/version.rb +1 -1
- data/lib/cacheflow.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83e311f4b1bb6c8bd7a57b7163409bee62be374072bf51ec1177751d1d6e1469
|
|
4
|
+
data.tar.gz: 4df0794c70e520f454d6fa7a0f1369fce78abed94e664dc86513005e60c2a159
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 06cb724109dcf6061f6a3635564e8438bfe0100545232d19e99a8980a9325ffe1ee8d1d9d541a70414131c376989c984802fcd80736cf43063e13da943c1ef64
|
|
7
|
+
data.tar.gz: 9da38e3824cccee4a0cb45534d7f2ef94609e8ed4bc4ce59eb81518101688286c11d355d489f4891334d5a582d84e121415f3400476b6d4ae0809b0cda6d9278
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## 0.6.0 (2026-04-01)
|
|
2
|
+
|
|
3
|
+
- Added support for Dalli 5
|
|
4
|
+
- Fixed `silence_sidekiq!` method for Sidekiq 7+
|
|
5
|
+
- Dropped support for `redis` < 5
|
|
6
|
+
- Dropped support for Ruby < 3.3 and Active Support < 7.2
|
|
7
|
+
|
|
1
8
|
## 0.5.0 (2025-05-05)
|
|
2
9
|
|
|
3
10
|
- Dropped support for Ruby < 3.2 and Active Support < 7.1
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Colorized logging for Memcached, Redis, and Valkey
|
|
4
4
|
|
|
5
|
-
Works with the Rails cache, as well as [Dalli](https://github.com/petergoldstein/dalli)
|
|
5
|
+
Works with the Rails cache, as well as [Dalli](https://github.com/petergoldstein/dalli), [Redis](https://github.com/redis/redis-rb), and [RedisClient](https://github.com/redis-rb/redis-client) clients directly
|
|
6
6
|
|
|
7
7
|
[](https://github.com/ankane/cacheflow/actions)
|
|
8
8
|
|
|
@@ -26,7 +26,7 @@ Cacheflow.silence do
|
|
|
26
26
|
end
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
To silence logging for [Sidekiq](https://github.com/
|
|
29
|
+
To silence logging for [Sidekiq](https://github.com/sidekiq/sidekiq) commands, create an initializer with:
|
|
30
30
|
|
|
31
31
|
```ruby
|
|
32
32
|
Cacheflow.silence_sidekiq!
|
|
@@ -34,7 +34,7 @@ Cacheflow.silence_sidekiq!
|
|
|
34
34
|
|
|
35
35
|
## Data Protection
|
|
36
36
|
|
|
37
|
-
If you use Cacheflow in an environment with [personal data](https://en.wikipedia.org/wiki/
|
|
37
|
+
If you use Cacheflow in an environment with [personal data](https://en.wikipedia.org/wiki/Personal_data) and store that data in Memcached, Redis, or Valkey, it can end up in your app logs. To avoid this, silence logging for those calls.
|
|
38
38
|
|
|
39
39
|
## History
|
|
40
40
|
|
data/lib/cacheflow/memcached.rb
CHANGED
|
@@ -23,9 +23,12 @@ module Cacheflow
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
if defined?(Dalli::Protocol::Meta)
|
|
27
|
+
Dalli::Protocol::Meta.prepend(Cacheflow::Memcached::Notifications)
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
if defined?(Dalli::Protocol::Binary)
|
|
27
31
|
Dalli::Protocol::Binary.prepend(Cacheflow::Memcached::Notifications)
|
|
28
|
-
else
|
|
29
|
-
Dalli::Server.prepend(Cacheflow::Memcached::Notifications)
|
|
30
32
|
end
|
|
33
|
+
|
|
31
34
|
Cacheflow::Memcached::Instrumenter.attach_to(:memcached)
|
data/lib/cacheflow/redis.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
module Cacheflow
|
|
2
2
|
module Redis
|
|
3
|
-
# redis 5 / redis-client
|
|
4
3
|
module ClientNotifications
|
|
5
4
|
def call(command, redis_config)
|
|
6
5
|
payload = {
|
|
@@ -21,18 +20,6 @@ module Cacheflow
|
|
|
21
20
|
end
|
|
22
21
|
end
|
|
23
22
|
|
|
24
|
-
# redis 4
|
|
25
|
-
module Notifications
|
|
26
|
-
def logging(commands)
|
|
27
|
-
payload = {
|
|
28
|
-
commands: commands
|
|
29
|
-
}
|
|
30
|
-
ActiveSupport::Notifications.instrument("query.redis", payload) do
|
|
31
|
-
super
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
23
|
class Instrumenter < ActiveSupport::LogSubscriber
|
|
37
24
|
def query(event)
|
|
38
25
|
return if !logger.debug? || Cacheflow.silenced?
|
|
@@ -50,11 +37,5 @@ module Cacheflow
|
|
|
50
37
|
end
|
|
51
38
|
end
|
|
52
39
|
|
|
53
|
-
|
|
54
|
-
RedisClient.register(Cacheflow::Redis::ClientNotifications)
|
|
55
|
-
elsif defined?(Redis)
|
|
56
|
-
# redis < 5
|
|
57
|
-
Redis::Client.prepend(Cacheflow::Redis::Notifications)
|
|
58
|
-
end
|
|
59
|
-
|
|
40
|
+
RedisClient.register(Cacheflow::Redis::ClientNotifications)
|
|
60
41
|
Cacheflow::Redis::Instrumenter.attach_to(:redis)
|
data/lib/cacheflow/sidekiq.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Cacheflow
|
|
2
2
|
module Sidekiq
|
|
3
|
-
module
|
|
4
|
-
def redis(
|
|
3
|
+
module InstanceMethods
|
|
4
|
+
def redis(...)
|
|
5
5
|
Cacheflow.silence do
|
|
6
6
|
super
|
|
7
7
|
end
|
|
@@ -10,7 +10,7 @@ module Cacheflow
|
|
|
10
10
|
|
|
11
11
|
module Client
|
|
12
12
|
module InstanceMethods
|
|
13
|
-
def push(
|
|
13
|
+
def push(...)
|
|
14
14
|
Cacheflow.silence do
|
|
15
15
|
super
|
|
16
16
|
end
|
|
@@ -20,5 +20,9 @@ module Cacheflow
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
if defined?(::Sidekiq::Capsule)
|
|
24
|
+
::Sidekiq::Capsule.prepend(Cacheflow::Sidekiq::InstanceMethods)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
::Sidekiq::Config.prepend(Cacheflow::Sidekiq::InstanceMethods)
|
|
24
28
|
::Sidekiq::Client.prepend(Cacheflow::Sidekiq::Client::InstanceMethods)
|
data/lib/cacheflow/version.rb
CHANGED
data/lib/cacheflow.rb
CHANGED
|
@@ -7,7 +7,7 @@ require_relative "cacheflow/version"
|
|
|
7
7
|
module Cacheflow
|
|
8
8
|
def self.activate
|
|
9
9
|
require_relative "cacheflow/memcached" if defined?(Dalli)
|
|
10
|
-
require_relative "cacheflow/redis" if defined?(
|
|
10
|
+
require_relative "cacheflow/redis" if defined?(RedisClient)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def self.silenced?
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cacheflow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '7.
|
|
18
|
+
version: '7.2'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '7.
|
|
25
|
+
version: '7.2'
|
|
26
26
|
email: andrew@ankane.org
|
|
27
27
|
executables: []
|
|
28
28
|
extensions: []
|
|
@@ -48,14 +48,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
48
48
|
requirements:
|
|
49
49
|
- - ">="
|
|
50
50
|
- !ruby/object:Gem::Version
|
|
51
|
-
version: '3.
|
|
51
|
+
version: '3.3'
|
|
52
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements:
|
|
54
54
|
- - ">="
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
56
|
version: '0'
|
|
57
57
|
requirements: []
|
|
58
|
-
rubygems_version:
|
|
58
|
+
rubygems_version: 4.0.6
|
|
59
59
|
specification_version: 4
|
|
60
60
|
summary: Colorized logging for Memcached, Redis, and Valkey
|
|
61
61
|
test_files: []
|