mondrian_redis_segment_cache 0.4.2-java → 0.4.3-java
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88709a1d58722c160949477aa669a4dd4b44b2dc
|
4
|
+
data.tar.gz: 57329e543ccd6864700b83d01e7d3df21ba4f0fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df69a5725f485e23119b0c878501a01e9bd98bacd744f972e6adc33cdb8def60b3c2ffe0693aebe20cb3b7626c8cf3b04f88788aa7fd3a2413bbea2ced7a215c
|
7
|
+
data.tar.gz: c9f30fec5cd3dbd0dc7eb906dee1279eb836ae341dc86e28ebff0bc54f97ebf110f261e067c51e5329e2b2b64176defd8fce6dfc9a3fc09af89bd15f5ed7fe59
|
@@ -142,10 +142,17 @@ module MondrianRedisSegmentCache
|
|
142
142
|
def expires_in_seconds
|
143
143
|
return options[:ttl] if options[:ttl]
|
144
144
|
|
145
|
+
expires_at = nil
|
145
146
|
now = Time.now
|
146
147
|
|
147
|
-
|
148
|
+
case
|
149
|
+
when options[:expires_callback]
|
150
|
+
expires_at = options[:expires_callback].call # for future configurability of expiry through registering callback
|
151
|
+
when options[:expires_at].is_a?(::Time)
|
148
152
|
expires_at = options[:expires_at]
|
153
|
+
when options[:expires] == :hourly
|
154
|
+
one_hour = now + 4200 # one hour, 10 minutes to cover the 10:59 problem where it would expire at 11
|
155
|
+
expires_at = ::Time.new(one_hour.year, one_hour.month, one_hour.day, one_hour.hour)
|
149
156
|
else
|
150
157
|
expires_at = ::Time.new(now.year, now.month, now.day, options[:expires_at])
|
151
158
|
end
|