alephant-broker 3.17.0 → 3.18.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/.travis.yml +1 -1
- data/alephant-broker.gemspec +1 -1
- data/lib/alephant/broker/cache/client.rb +2 -3
- data/lib/alephant/broker/version.rb +1 -1
- data/spec/alephant/broker/cache/client_spec.rb +29 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7359058509b2fff49fd7a29c3425c713c6c0738
|
4
|
+
data.tar.gz: e42c65579c05d327a18a6d5a2991c53d2ed81dd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87fe78ddd8702e94d9b4a981a1770fb0a55c0e4a90ea6ed8c9f80e9927249b830c52ae94f0aa38655a2c5237cc94d7a0dc83e01c4b2714551e72f46ebc803c0a
|
7
|
+
data.tar.gz: be68d83eee04548185a8880b569ba4f010b2fca364d4751c0ba8c6922fe65f4ad493fe52abd3e827ff771f72c83c9dea37b6f327a4ab0d7110cd34bff1f96cb1
|
data/.travis.yml
CHANGED
data/alephant-broker.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_runtime_dependency 'alephant-sequencer'
|
40
40
|
spec.add_runtime_dependency "aws-sdk-sqs"
|
41
41
|
spec.add_runtime_dependency "aws-sdk-s3"
|
42
|
-
spec.add_runtime_dependency "dalli
|
42
|
+
spec.add_runtime_dependency "dalli"
|
43
43
|
spec.add_runtime_dependency "faraday"
|
44
44
|
spec.add_runtime_dependency "crimp"
|
45
45
|
spec.add_runtime_dependency "listen", "~> 3.0.0"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'dalli
|
1
|
+
require 'dalli'
|
2
2
|
require 'alephant/logger'
|
3
3
|
|
4
4
|
module Alephant
|
@@ -15,8 +15,7 @@ module Alephant
|
|
15
15
|
logger.metric 'NoConfigEndpoint'
|
16
16
|
@client = NullClient.new
|
17
17
|
else
|
18
|
-
@
|
19
|
-
@client ||= @elasticache.client
|
18
|
+
@client ||= Dalli::Client.new(config_endpoint, expires_in: ttl)
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Alephant::Broker::Cache::Client do
|
4
|
+
before do
|
5
|
+
allow(Alephant::Broker).to receive(:config).and_return(config)
|
6
|
+
end
|
7
|
+
|
8
|
+
context 'when creating a new cache client with no cache endpoint' do
|
9
|
+
let(:config) { {} }
|
10
|
+
|
11
|
+
it 'creates a cache client with a null client backend' do
|
12
|
+
expect(Alephant::Broker::Cache::NullClient).to receive(:new)
|
13
|
+
expect(Dalli::Client).not_to receive(:new)
|
14
|
+
|
15
|
+
expect(described_class.new).to be_a described_class
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'when creating a new cache client with a cache endpoint' do
|
20
|
+
let(:config) { { elasticache_config_endpoint: 'abc123.elasticache.aws.com:11211' } }
|
21
|
+
|
22
|
+
it 'creates a cache client with a null client backend' do
|
23
|
+
expect(Alephant::Broker::Cache::NullClient).not_to receive(:new)
|
24
|
+
expect(Dalli::Client).to receive(:new)
|
25
|
+
|
26
|
+
expect(described_class.new).to be_a described_class
|
27
|
+
end
|
28
|
+
end
|
29
|
+
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: 3.
|
4
|
+
version: 3.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BBC News
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -291,7 +291,7 @@ dependencies:
|
|
291
291
|
- !ruby/object:Gem::Version
|
292
292
|
version: '0'
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
|
-
name: dalli
|
294
|
+
name: dalli
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|
296
296
|
requirements:
|
297
297
|
- - ">="
|
@@ -397,6 +397,7 @@ files:
|
|
397
397
|
- lib/alephant/broker/response/factory.rb
|
398
398
|
- lib/alephant/broker/version.rb
|
399
399
|
- spec/alephant/broker/cache/cached_object_spec.rb
|
400
|
+
- spec/alephant/broker/cache/client_spec.rb
|
400
401
|
- spec/alephant/broker/component_meta_spec.rb
|
401
402
|
- spec/alephant/broker/load_strategy/http_spec.rb
|
402
403
|
- spec/alephant/broker/load_strategy/revalidate/fetcher_spec.rb
|
@@ -431,12 +432,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
431
432
|
version: '0'
|
432
433
|
requirements: []
|
433
434
|
rubyforge_project:
|
434
|
-
rubygems_version: 2.6.
|
435
|
+
rubygems_version: 2.6.14
|
435
436
|
signing_key:
|
436
437
|
specification_version: 4
|
437
438
|
summary: Brokers requests for alephant components
|
438
439
|
test_files:
|
439
440
|
- spec/alephant/broker/cache/cached_object_spec.rb
|
441
|
+
- spec/alephant/broker/cache/client_spec.rb
|
440
442
|
- spec/alephant/broker/component_meta_spec.rb
|
441
443
|
- spec/alephant/broker/load_strategy/http_spec.rb
|
442
444
|
- spec/alephant/broker/load_strategy/revalidate/fetcher_spec.rb
|