ci-queue 0.24.0 → 0.24.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ci/queue/redis/base.rb +9 -1
- data/lib/ci/queue/redis/worker.rb +0 -2
- data/lib/ci/queue/static.rb +10 -0
- data/lib/ci/queue/version.rb +1 -1
- data/lib/minitest/queue/runner.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dddff029008b5dbe7ff19995f824f6c1d54a19e699377742a6e4599642f4b55
|
4
|
+
data.tar.gz: 9ff1268a7be473c4f35cb907193b24e04ae22189df0c116be9cc09db50112925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 755d03be6402d76d3d225c5c4dae6dafdf60f604fb6377c48403f98898b6ee6bc44634ad8d5dfdafe15f9ca2e3b8e304244850984f75aed67ae872064e9caedf
|
7
|
+
data.tar.gz: 157c12e846214542d78116fa168e380eba0b9266bcd2f3194d28c55951cc9c11cbc015582654ad6dfe09fac852e1123f3b9bbd8cd5b936ecdbf4075ce6a06784
|
data/lib/ci/queue/redis/base.rb
CHANGED
@@ -22,7 +22,7 @@ module CI
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def expired?
|
25
|
-
if (created_at = redis.get(key('
|
25
|
+
if (created_at = redis.get(key('created-at')))
|
26
26
|
(created_at.to_f + config.redis_ttl + TEN_MINUTES) < Time.now.to_f
|
27
27
|
else
|
28
28
|
# if there is no created at set anymore we assume queue is expired
|
@@ -30,6 +30,10 @@ module CI
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
def created_at=(timestamp)
|
34
|
+
redis.setnx(key('created-at'), timestamp)
|
35
|
+
end
|
36
|
+
|
33
37
|
def size
|
34
38
|
redis.multi do |transaction|
|
35
39
|
transaction.llen(key('queue'))
|
@@ -71,6 +75,10 @@ module CI
|
|
71
75
|
end
|
72
76
|
end
|
73
77
|
|
78
|
+
def queue_initializing?
|
79
|
+
master_status == 'setup'
|
80
|
+
end
|
81
|
+
|
74
82
|
def increment_test_failed
|
75
83
|
redis.incr(key('test_failed_count'))
|
76
84
|
end
|
@@ -202,12 +202,10 @@ module CI
|
|
202
202
|
transaction.lpush(key('queue'), tests) unless tests.empty?
|
203
203
|
transaction.set(key('total'), @total)
|
204
204
|
transaction.set(key('master-status'), 'ready')
|
205
|
-
transaction.set(key('master-created-at'), Time.now.to_f)
|
206
205
|
|
207
206
|
transaction.expire(key('queue'), config.redis_ttl)
|
208
207
|
transaction.expire(key('total'), config.redis_ttl)
|
209
208
|
transaction.expire(key('master-status'), config.redis_ttl)
|
210
|
-
transaction.expire(key('master-created-at'), config.redis_ttl)
|
211
209
|
end
|
212
210
|
end
|
213
211
|
register
|
data/lib/ci/queue/static.rb
CHANGED
@@ -11,6 +11,8 @@ module CI
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
TEN_MINUTES = 60 * 10
|
15
|
+
|
14
16
|
attr_reader :progress, :total
|
15
17
|
|
16
18
|
def initialize(tests, config)
|
@@ -37,6 +39,14 @@ module CI
|
|
37
39
|
self
|
38
40
|
end
|
39
41
|
|
42
|
+
def created_at=(timestamp)
|
43
|
+
@created_at ||= timestamp
|
44
|
+
end
|
45
|
+
|
46
|
+
def expired?
|
47
|
+
(@created_at.to_f TEN_MINUTES) < Time.now.to_f
|
48
|
+
end
|
49
|
+
|
40
50
|
def populated?
|
41
51
|
!!defined?(@index)
|
42
52
|
end
|
data/lib/ci/queue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci-queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|