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: 0c5b0fc11676333a22bf8d22f1c4ab0df228cb88
4
- data.tar.gz: 15b9f22447a307040ad73ac05d5e4deae2db36da
3
+ metadata.gz: 88709a1d58722c160949477aa669a4dd4b44b2dc
4
+ data.tar.gz: 57329e543ccd6864700b83d01e7d3df21ba4f0fb
5
5
  SHA512:
6
- metadata.gz: f6e90f71c3d5e5331f4c20470bd556e53797103d28bd054bd3265f7d5ce2f87a31ac90e3f6e5e77fc4d3e474ed9e81238d3bbd7241f8df5e4154685f51df691d
7
- data.tar.gz: 20e05ea1857664127c1889fd38360b37b648b8ccca84e318f0fca87ab09e3dbb281174d5a0047a102c6204dbe8162af0f1d0421d1e4976698c1f265a1e5fc561
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
- if options[:expires_at].is_a?(::Time)
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
@@ -1,3 +1,3 @@
1
1
  module MondrianRedisSegmentCache
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mondrian_redis_segment_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: java
6
6
  authors:
7
7
  - Brandon Dewitt