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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a5f5f63478b9c1b1419e33baf6039f8e92153638ba2c08dc60cadd1a968d117
4
- data.tar.gz: e222c79a85490ec2cbced43833b05b40e97dc6863782586505b19b178e44f664
3
+ metadata.gz: 5bcb4199fc1cea26510008421e3e1a1cdef9efc81eb5392f6a8913c70ae47ed1
4
+ data.tar.gz: '0266388a941c4e79d39b808d747d31d56dc957f8499ae1d14d553aceab7ac467'
5
5
  SHA512:
6
- metadata.gz: ffd5ee0e0b9bfc78e9f44086d2b60986483c4668acf9b9a282ed3110d15d59477fec68b1042876d52899fe2531648ccd793efa9ba92415231ad4e637922b8049
7
- data.tar.gz: 99fb91f000e510dd98eda1d843e644c563ca71288759e7d23493a605b7f7b342a116cff2d2bd530250fb552cd88d728a67171fafb49419461baa7200355d9e47
6
+ metadata.gz: 55f5bc10cf12986f073f2f3dd590ed17abac7e0ee25b8e4531391fd5d02e0297e6c7ed58961a626d98944c01395223fc75b4d2c49d28f31c85bbeca76bc21efe
7
+ data.tar.gz: 2a02585f01df20d868ac294c7daef8414ecefe3023d006869ea40c0aea9831361bdc5633e41787e86e20d4e39d749402baee385563adaf7e9405b7efad212a88
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ v0.4.2 - 16 Mar 2021
2
+ ---
3
+ Bug fix for process/task keys not expired upon completion.
4
+
1
5
  v0.4.1 - 15 Mar 2021
2
6
  ---
3
7
  Optimisation to exclude sub-processes which don't have any tasks.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- taskinator (0.4.1)
4
+ taskinator (0.4.2)
5
5
  builder (>= 3.2.2)
6
6
  connection_pool (>= 2.2.0)
7
7
  globalid (~> 0.3)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Taskinator
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -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
- expect(conn.hget(process.key, :uuid)).to eq(process.uuid)
382
+ # sanity check
383
+ expect(conn.keys).to be_empty
382
384
 
383
- process.cleanup(0) # immediately
385
+ process = definition.create_process(1)
384
386
 
385
- expect(conn.hget(process.key, :uuid)).to be_nil
387
+ # sanity check
388
+ expect(conn.hget(process.key, :uuid)).to eq(process.uuid)
386
389
 
387
- recursively_enumerate_tasks(process.tasks) do |task|
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
- # gone!
415
- expect(conn.hget(process.key, :uuid)).to be_nil
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.1
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-15 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis