taskinator 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/taskinator/persistence.rb +3 -0
- data/lib/taskinator/version.rb +1 -1
- data/spec/support/test_flows.rb +38 -0
- data/spec/taskinator/persistence_spec.rb +21 -17
- 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: 5bcb4199fc1cea26510008421e3e1a1cdef9efc81eb5392f6a8913c70ae47ed1
|
4
|
+
data.tar.gz: '0266388a941c4e79d39b808d747d31d56dc957f8499ae1d14d553aceab7ac467'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55f5bc10cf12986f073f2f3dd590ed17abac7e0ee25b8e4531391fd5d02e0297e6c7ed58961a626d98944c01395223fc75b4d2c49d28f31c85bbeca76bc21efe
|
7
|
+
data.tar.gz: 2a02585f01df20d868ac294c7daef8414ecefe3023d006869ea40c0aea9831361bdc5633e41787e86e20d4e39d749402baee385563adaf7e9405b7efad212a88
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -604,6 +604,9 @@ module Taskinator
|
|
604
604
|
end
|
605
605
|
|
606
606
|
def visit_tasks(tasks)
|
607
|
+
@conn.expire "#{@key}:tasks", expire_in
|
608
|
+
@conn.expire "#{@key}.count", expire_in
|
609
|
+
@conn.expire "#{@key}.pending", expire_in
|
607
610
|
tasks.each do |task|
|
608
611
|
RedisCleanupVisitor.new(@conn, task, expire_in).visit
|
609
612
|
end
|
data/lib/taskinator/version.rb
CHANGED
data/spec/support/test_flows.rb
CHANGED
@@ -132,4 +132,42 @@ module TestFlows
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
135
|
+
module NestedTask
|
136
|
+
extend Taskinator::Definition
|
137
|
+
include Support
|
138
|
+
|
139
|
+
define_process :task_count do
|
140
|
+
task :task_1
|
141
|
+
|
142
|
+
concurrent do
|
143
|
+
task :task_2
|
144
|
+
task :task_3
|
145
|
+
|
146
|
+
sequential do
|
147
|
+
task :task_4
|
148
|
+
task :task_5
|
149
|
+
|
150
|
+
concurrent do
|
151
|
+
task :task_6
|
152
|
+
task :task_7
|
153
|
+
|
154
|
+
sequential do
|
155
|
+
task :task_8
|
156
|
+
task :task_9
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
task :task_10
|
161
|
+
end
|
162
|
+
|
163
|
+
task :task_11
|
164
|
+
end
|
165
|
+
|
166
|
+
task :task_12
|
167
|
+
end
|
168
|
+
|
169
|
+
task :task_13
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
135
173
|
end
|
@@ -370,24 +370,27 @@ describe Taskinator::Persistence, :redis => true do
|
|
370
370
|
TestFlows::Job,
|
371
371
|
TestFlows::SubProcess,
|
372
372
|
TestFlows::Sequential,
|
373
|
-
TestFlows::Concurrent
|
373
|
+
TestFlows::Concurrent,
|
374
|
+
TestFlows::EmptySequentialProcessTest,
|
375
|
+
TestFlows::EmptyConcurrentProcessTest,
|
376
|
+
TestFlows::NestedTask,
|
374
377
|
].each do |definition|
|
375
378
|
|
376
379
|
describe "#{definition.name} expire immediately" do
|
377
380
|
it {
|
378
|
-
process = definition.create_process(1)
|
379
|
-
|
380
381
|
Taskinator.redis do |conn|
|
381
|
-
|
382
|
+
# sanity check
|
383
|
+
expect(conn.keys).to be_empty
|
382
384
|
|
383
|
-
process.
|
385
|
+
process = definition.create_process(1)
|
384
386
|
|
385
|
-
|
387
|
+
# sanity check
|
388
|
+
expect(conn.hget(process.key, :uuid)).to eq(process.uuid)
|
386
389
|
|
387
|
-
|
388
|
-
expect(conn.hget(task.key, :uuid)).to be_nil
|
389
|
-
end
|
390
|
+
process.cleanup(0) # immediately
|
390
391
|
|
392
|
+
# ensure nothing left behind
|
393
|
+
expect(conn.keys).to be_empty
|
391
394
|
end
|
392
395
|
}
|
393
396
|
end
|
@@ -396,9 +399,14 @@ describe Taskinator::Persistence, :redis => true do
|
|
396
399
|
|
397
400
|
describe "expires in future" do
|
398
401
|
it {
|
399
|
-
process = TestFlows::Task.create_process(1)
|
400
|
-
|
401
402
|
Taskinator.redis do |conn|
|
403
|
+
|
404
|
+
# sanity check
|
405
|
+
expect(conn.keys).to be_empty
|
406
|
+
|
407
|
+
process = TestFlows::Task.create_process(1)
|
408
|
+
|
409
|
+
# sanity check
|
402
410
|
expect(conn.hget(process.key, :uuid)).to eq(process.uuid)
|
403
411
|
|
404
412
|
process.cleanup(2)
|
@@ -411,12 +419,8 @@ describe Taskinator::Persistence, :redis => true do
|
|
411
419
|
|
412
420
|
sleep 3
|
413
421
|
|
414
|
-
#
|
415
|
-
expect(conn.
|
416
|
-
recursively_enumerate_tasks(process.tasks) do |task|
|
417
|
-
expect(conn.hget(task.key, :uuid)).to be_nil
|
418
|
-
end
|
419
|
-
|
422
|
+
# ensure nothing left behind
|
423
|
+
expect(conn.keys).to be_empty
|
420
424
|
end
|
421
425
|
}
|
422
426
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taskinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Stefano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|