alephant-broker 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alephant/broker/cache.rb +4 -4
- data/lib/alephant/broker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565f5f6b0ad1c0dcfd6024bae98ce1fd1afcb21f
|
4
|
+
data.tar.gz: f3f17262eb4a373874951c16c1cd9a8ec0c3d19b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d77b8eca85c8ee60f7dad50445e49cc93da881dd46050e53d8c609661f7312b0c3a9a68f79a0cd98209e3bbf7760e45f9ca060cd773b62ff86c2c536ece0baeb
|
7
|
+
data.tar.gz: ee3493fc5ceb18f301893127c6dfaf2097631bb310d110e2173b5d7c2960d8fb56ec767867ef1a86802b4c6d83a77e2419b39fefac130678f7ea570b2da672b2
|
@@ -13,10 +13,10 @@ module Alephant
|
|
13
13
|
def initialize
|
14
14
|
unless config_endpoint.nil?
|
15
15
|
@@elasticache ||= ::Dalli::ElastiCache.new(config_endpoint, { :expires_in => ttl })
|
16
|
-
|
16
|
+
@@client ||= @@elasticache.client
|
17
17
|
else
|
18
18
|
logger.debug('Broker::Cache::Client#initialize: No config endpoint, NullClient used')
|
19
|
-
|
19
|
+
@@client = NullClient.new
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -30,7 +30,7 @@ module Alephant
|
|
30
30
|
|
31
31
|
def get(key, &block)
|
32
32
|
begin
|
33
|
-
result =
|
33
|
+
result = @@client.get(key)
|
34
34
|
logger.info("Broker::Cache::Client#get key: #{key} - #{result ? 'hit' : 'miss'}")
|
35
35
|
result ? result : set(key, block.call)
|
36
36
|
rescue StandardError => e
|
@@ -39,7 +39,7 @@ module Alephant
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def set(key, value)
|
42
|
-
value.tap { |o|
|
42
|
+
value.tap { |o| @@client.set(key, o) }
|
43
43
|
end
|
44
44
|
|
45
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|