ci-queue 0.65.0 → 0.66.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/Gemfile.lock +1 -1
- data/lib/ci/queue/redis/base.rb +4 -1
- data/lib/ci/queue/redis/worker.rb +8 -1
- data/lib/ci/queue/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b78efa3839e0fdc3a3998ef7d664bab01f28d0cdde96c28b790f9c912964d33a
|
4
|
+
data.tar.gz: 4bc014eb8401ce329be509dc76f449a4d80696667563e3236c5f9634514b7df0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be5f84376a0a6bc93776eaafa4a725e48061e18ea13d79c407cb599b665201031fc189ae91cd89607f3c2fa062eb388caaa554411405cc7adf6b073610ee078f
|
7
|
+
data.tar.gz: 47057ca6d1b2d35eb0068be06330802a0ce614744f8498d069ef9bc1ffdd499a8a38861a3bfa7aa62e2b10becd0be5c99306026938c7ca704ede42396109367c
|
data/Gemfile.lock
CHANGED
data/lib/ci/queue/redis/base.rb
CHANGED
@@ -11,6 +11,8 @@ module CI
|
|
11
11
|
::SocketError, # https://github.com/redis/redis-rb/pull/631
|
12
12
|
].freeze
|
13
13
|
|
14
|
+
DEFAULT_TIMEOUT = 2
|
15
|
+
|
14
16
|
module RedisInstrumentation
|
15
17
|
def call(command, redis_config)
|
16
18
|
logger = redis_config.custom[:debug_log]
|
@@ -45,9 +47,10 @@ module CI
|
|
45
47
|
# ci-queue should not contain any sensitive data, so we can just disable the verification.
|
46
48
|
ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE },
|
47
49
|
custom: custom_config,
|
50
|
+
timeout: DEFAULT_TIMEOUT,
|
48
51
|
)
|
49
52
|
else
|
50
|
-
@redis = ::Redis.new(url: redis_url)
|
53
|
+
@redis = ::Redis.new(url: redis_url, timeout: DEFAULT_TIMEOUT)
|
51
54
|
end
|
52
55
|
end
|
53
56
|
|
@@ -201,7 +201,14 @@ module CI
|
|
201
201
|
def push(tests)
|
202
202
|
@total = tests.size
|
203
203
|
|
204
|
-
|
204
|
+
# We set a unique value (worker_id) and read it back to make "SET if Not eXists" idempotent in case of a retry.
|
205
|
+
value = key('setup', worker_id)
|
206
|
+
_, status = redis.pipelined do |pipeline|
|
207
|
+
pipeline.set(key('master-status'), value, nx: true)
|
208
|
+
pipeline.get(key('master-status'))
|
209
|
+
end
|
210
|
+
|
211
|
+
if @master = (value == status)
|
205
212
|
puts "Worker electected as leader, pushing #{@total} tests to the queue."
|
206
213
|
puts
|
207
214
|
|
data/lib/ci/queue/version.rb
CHANGED