gitlab-mail_room 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mail_room/arbitration/redis.rb +1 -1
- data/lib/mail_room/version.rb +1 -1
- data/mail_room.gemspec +1 -1
- data/spec/lib/arbitration/redis_spec.rb +6 -5
- data/spec/lib/delivery/sidekiq_spec.rb +7 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b35546ba9ef63ad546144c97515d7203a56182abb48be0b4975061e7c8598555
|
4
|
+
data.tar.gz: c6d96b85320aeafd0b41004e6b606aad1a3642de8ebee52734becc92de387185
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9732c479849c02606adfda10314f3cfd5d83a8c1283d4054b5464480a3eae20f1414e0db0147a8b8cf383fe0fd4d073fcc0f522377792a4fed0d64daa621ad6f
|
7
|
+
data.tar.gz: a7d5f829af0796d81deeb8b4b570c932723f0bcfb0d80f322e9bed02dddd809a286cac2beff486c199b992d3d93d1646f268e15b983f8e3e0eae6a8c0c36fb3c
|
@@ -31,7 +31,7 @@ module MailRoom
|
|
31
31
|
# Any subsequent failure in the instance which gets the lock will be dealt
|
32
32
|
# with by the expiration, at which time another instance can pick up the
|
33
33
|
# message and try again.
|
34
|
-
client.set(key, 1,
|
34
|
+
client.set(key, 1, nx: true, ex: expiration)
|
35
35
|
end
|
36
36
|
|
37
37
|
private
|
data/lib/mail_room/version.rb
CHANGED
data/mail_room.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |gem|
|
|
35
35
|
gem.add_development_dependency "faraday"
|
36
36
|
gem.add_development_dependency "mail"
|
37
37
|
gem.add_development_dependency "letter_opener"
|
38
|
-
gem.add_development_dependency "redis", "~>
|
38
|
+
gem.add_development_dependency "redis", "~> 4"
|
39
39
|
gem.add_development_dependency "redis-namespace"
|
40
40
|
gem.add_development_dependency "pg"
|
41
41
|
gem.add_development_dependency "charlock_holmes"
|
@@ -15,6 +15,7 @@ describe MailRoom::Arbitration::Redis do
|
|
15
15
|
|
16
16
|
# Private, but we don't care.
|
17
17
|
let(:redis) { subject.send(:client) }
|
18
|
+
let(:raw_client) { redis._client }
|
18
19
|
|
19
20
|
describe '#deliver?' do
|
20
21
|
context "when called the first time" do
|
@@ -95,7 +96,7 @@ describe MailRoom::Arbitration::Redis do
|
|
95
96
|
it 'client has same specified url' do
|
96
97
|
subject.deliver?(123)
|
97
98
|
|
98
|
-
expect(
|
99
|
+
expect(raw_client.options[:url]).to eq redis_url
|
99
100
|
end
|
100
101
|
|
101
102
|
it 'client is a instance of Redis class' do
|
@@ -137,10 +138,10 @@ describe MailRoom::Arbitration::Redis do
|
|
137
138
|
before { ::Redis::Client::Connector::Sentinel.any_instance.stubs(:resolve).returns(sentinels) }
|
138
139
|
|
139
140
|
it 'client has same specified sentinel params' do
|
140
|
-
expect(
|
141
|
-
expect(
|
142
|
-
expect(
|
143
|
-
expect(
|
141
|
+
expect(raw_client.instance_variable_get(:@connector)).to be_a Redis::Client::Connector::Sentinel
|
142
|
+
expect(raw_client.options[:host]).to eq('sentinel-master')
|
143
|
+
expect(raw_client.options[:password]).to eq('mypassword')
|
144
|
+
expect(raw_client.options[:sentinels]).to eq(sentinels)
|
144
145
|
end
|
145
146
|
end
|
146
147
|
end
|
@@ -4,6 +4,7 @@ require 'mail_room/delivery/sidekiq'
|
|
4
4
|
describe MailRoom::Delivery::Sidekiq do
|
5
5
|
subject { described_class.new(options) }
|
6
6
|
let(:redis) { subject.send(:client) }
|
7
|
+
let(:raw_client) { redis._client }
|
7
8
|
let(:options) { MailRoom::Delivery::Sidekiq::Options.new(mailbox) }
|
8
9
|
|
9
10
|
describe '#options' do
|
@@ -20,7 +21,7 @@ describe MailRoom::Delivery::Sidekiq do
|
|
20
21
|
|
21
22
|
context 'with simple redis url' do
|
22
23
|
it 'client has same specified redis_url' do
|
23
|
-
expect(
|
24
|
+
expect(raw_client.options[:url]).to eq(redis_url)
|
24
25
|
end
|
25
26
|
|
26
27
|
it 'client is a instance of RedisNamespace class' do
|
@@ -39,7 +40,7 @@ describe MailRoom::Delivery::Sidekiq do
|
|
39
40
|
end
|
40
41
|
|
41
42
|
it 'client has correct redis_url' do
|
42
|
-
expect(
|
43
|
+
expect(raw_client.options[:url]).to eq(redis_url)
|
43
44
|
end
|
44
45
|
|
45
46
|
|
@@ -87,10 +88,10 @@ describe MailRoom::Delivery::Sidekiq do
|
|
87
88
|
before { ::Redis::Client::Connector::Sentinel.any_instance.stubs(:resolve).returns(sentinels) }
|
88
89
|
|
89
90
|
it 'client has same specified sentinel params' do
|
90
|
-
expect(
|
91
|
-
expect(
|
92
|
-
expect(
|
93
|
-
expect(
|
91
|
+
expect(raw_client.instance_variable_get(:@connector)).to be_a Redis::Client::Connector::Sentinel
|
92
|
+
expect(raw_client.options[:host]).to eq('sentinel-master')
|
93
|
+
expect(raw_client.options[:password]).to eq('mypassword')
|
94
|
+
expect(raw_client.options[:sentinels]).to eq(sentinels)
|
94
95
|
end
|
95
96
|
end
|
96
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-mail_room
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Pitale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-imap
|
@@ -198,14 +198,14 @@ dependencies:
|
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: '4'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: '4'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: redis-namespace
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|