legion-cache 1.3.14 → 1.3.15
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/lib/legion/cache/version.rb +1 -1
- data/lib/legion/cache.rb +20 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d143549258e7e7a2ec8d3ff702a724eb98648582a442c594bd8df360f8fd1c5
|
|
4
|
+
data.tar.gz: cff229d7de54b78aa9b3995a8fa9d5877e059ab32059fadb786b786357fbebaf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 073ea47e6e2c886388fa980f490cf395bbfe3be1a90129cc3d804ea5df36d7c8ee814e725e1bcaae94b35d840c0729b47ab5181d5c7f12581e2c3664d76a74b3
|
|
7
|
+
data.tar.gz: 82599629d8df3d385c96001321e55c123670154cbc72e243ded365d4f22d93dc085e19bfa2605fb377fab69e0be21291d46937450702d1b4a70860e41d06efde
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.15] - 2026-03-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- PHI-aware TTL enforcement: `Cache.set` accepts `phi: true` keyword option; TTL is capped at `cache.compliance.phi_max_ttl` (default 3600s) when set
|
|
7
|
+
- `Legion::Cache.phi_max_ttl` — reads `cache.compliance.phi_max_ttl` from settings with 3600s default
|
|
8
|
+
- `Legion::Cache.enforce_phi_ttl(ttl, phi:)` — public helper for PHI TTL cap logic
|
|
9
|
+
|
|
3
10
|
## [1.3.14] - 2026-03-24
|
|
4
11
|
|
|
5
12
|
### Added
|
data/lib/legion/cache/version.rb
CHANGED
data/lib/legion/cache.rb
CHANGED
|
@@ -64,11 +64,27 @@ module Legion
|
|
|
64
64
|
super
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
def
|
|
68
|
-
return Legion::
|
|
69
|
-
return Legion::Cache::Local.set(key, value, ttl) if @using_local
|
|
67
|
+
def phi_max_ttl
|
|
68
|
+
return 3600 unless defined?(Legion::Settings)
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
Legion::Settings.dig(:cache, :compliance, :phi_max_ttl) || 3600
|
|
71
|
+
rescue StandardError
|
|
72
|
+
3600
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def enforce_phi_ttl(ttl, phi: false, **)
|
|
76
|
+
return ttl unless phi == true
|
|
77
|
+
|
|
78
|
+
max = phi_max_ttl
|
|
79
|
+
[ttl, max].min
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def set(key, value, ttl = 180, **)
|
|
83
|
+
effective_ttl = enforce_phi_ttl(ttl, **)
|
|
84
|
+
return Legion::Cache::Memory.set(key, value, effective_ttl) if @using_memory
|
|
85
|
+
return Legion::Cache::Local.set(key, value, effective_ttl) if @using_local
|
|
86
|
+
|
|
87
|
+
super(key, value, effective_ttl)
|
|
72
88
|
end
|
|
73
89
|
|
|
74
90
|
def fetch(key, ttl = nil)
|