taskinator 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/taskinator/persistence.rb +12 -12
- data/lib/taskinator/version.rb +1 -1
- data/spec/taskinator/api_spec.rb +4 -4
- 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: 0ea786056f74987f21643d392336032d09896df7ddc01d462a78a257a19088d8
|
4
|
+
data.tar.gz: f693f14e2dac9341f1c83c6bf04b12da9d96261498198cc712e71be5b4b51955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6151322f48c6215c41ffeeb6fc08d43aa871f9f76d04f628c80d29fa423b22fb0a3ee589803efd1503c3b59491bc4e2ace36879f801638898b9ace0557e4f180
|
7
|
+
data.tar.gz: 65ba806d211f62c8ff12ea3c036b037f53567a17f1a848129ba8f737d4fc0267be7435d6e315591afa81527275042bf22cc04066c74684b6cc54b0e3ce8691f8
|
data/Gemfile.lock
CHANGED
@@ -53,9 +53,9 @@ module Taskinator
|
|
53
53
|
|
54
54
|
def save
|
55
55
|
Taskinator.redis do |conn|
|
56
|
-
conn.pipelined do
|
57
|
-
visitor = RedisSerializationVisitor.new(
|
58
|
-
|
56
|
+
conn.pipelined do |pipeline|
|
57
|
+
visitor = RedisSerializationVisitor.new(pipeline, self).visit
|
58
|
+
pipeline.hmset(
|
59
59
|
Taskinator::Process.key_for(uuid),
|
60
60
|
:tasks_count, visitor.task_count,
|
61
61
|
:tasks_failed, 0,
|
@@ -109,15 +109,15 @@ module Taskinator
|
|
109
109
|
@updated_at = Time.now.utc
|
110
110
|
Taskinator.redis do |conn|
|
111
111
|
process_key = self.process_key
|
112
|
-
conn.multi do
|
113
|
-
|
112
|
+
conn.multi do |transaction|
|
113
|
+
transaction.hmset(
|
114
114
|
self.key,
|
115
115
|
:state, new_state,
|
116
116
|
:updated_at, @updated_at
|
117
117
|
)
|
118
118
|
|
119
119
|
# also update the "root" process
|
120
|
-
|
120
|
+
transaction.hset(
|
121
121
|
process_key,
|
122
122
|
:updated_at, @updated_at
|
123
123
|
)
|
@@ -178,9 +178,9 @@ module Taskinator
|
|
178
178
|
define_method "incr_#{status}" do
|
179
179
|
Taskinator.redis do |conn|
|
180
180
|
process_key = self.process_key
|
181
|
-
conn.multi do
|
182
|
-
|
183
|
-
|
181
|
+
conn.multi do |transaction|
|
182
|
+
transaction.hincrby process_key, "tasks_#{status}", 1
|
183
|
+
transaction.hset process_key, :updated_at, Time.now.utc
|
184
184
|
end
|
185
185
|
end
|
186
186
|
end
|
@@ -467,9 +467,9 @@ module Taskinator
|
|
467
467
|
|
468
468
|
# pre-load all the attributes to reduce redis hits
|
469
469
|
Taskinator.redis do |conn|
|
470
|
-
keys, values = conn.multi do
|
471
|
-
|
472
|
-
|
470
|
+
keys, values = conn.multi do |transaction|
|
471
|
+
transaction.hkeys(@key)
|
472
|
+
transaction.hvals(@key)
|
473
473
|
end
|
474
474
|
@attribute_values = Hash[keys.collect(&:to_sym).zip(values)]
|
475
475
|
end
|
data/lib/taskinator/version.rb
CHANGED
data/spec/taskinator/api_spec.rb
CHANGED
@@ -17,8 +17,8 @@ describe Taskinator::Api, :redis => true do
|
|
17
17
|
allow_any_instance_of(Process).to receive(:fetch) {}
|
18
18
|
|
19
19
|
Taskinator.redis do |conn|
|
20
|
-
conn.multi do
|
21
|
-
3.times {|i|
|
20
|
+
conn.multi do |transaction|
|
21
|
+
3.times {|i| transaction.sadd(Taskinator::Persistence.processes_list_key, i) }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -34,8 +34,8 @@ describe Taskinator::Api, :redis => true do
|
|
34
34
|
|
35
35
|
it "yields the number of processes" do
|
36
36
|
Taskinator.redis do |conn|
|
37
|
-
conn.multi do
|
38
|
-
3.times {|i|
|
37
|
+
conn.multi do |transaction|
|
38
|
+
3.times {|i| transaction.sadd(Taskinator::Persistence.processes_list_key, i) }
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Stefano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|