distributed_job 3.0.0 → 3.0.1

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: 62f2efef7acceccdd2dc3339969cb9eed235f5e8df8367cdb88ddafdf00bc386
4
- data.tar.gz: 90c9eb945bc7a3b0f4ec7526e2c87b953a866f7ea56972ecfe01dc296c325516
3
+ metadata.gz: 8bda4273dc59888e0269d7d14d69180e9a67bdb793e9c7f9f24bcc9f88a1b8fd
4
+ data.tar.gz: 8a3108b573a9e46e78d57979dfab70906459947651c1b2cda1391f66aa8e0f93
5
5
  SHA512:
6
- metadata.gz: 7e919014940a31859cf709a00f1be04d8b4cc015f7cd068808645474687c47ca55f77f4c5b608f511137a7c3c5c1fefca1a8c99989ca51f911f4fd9d893b6c50
7
- data.tar.gz: d02553e6c36caffdfdfa78940ccfdce1478a41e4750facee08b5829540b362582fb740e6cc612f853b545ed73e69ebfbbb1e7480d756c4a2fd4da4889962909b
6
+ metadata.gz: e553072546911dffba6bd7f40e9f4eb6c7fe4f0a0338437ffc21cdc8e442c91cb0b51fa2afbcf070e257d2caaade5954867710e14e7919fde335aaebb8ec3867
7
+ data.tar.gz: 86ae97dd953642cc225f6b4280776c84dfc080cc4af90d8519352f6d4faf0a26ab736df372cac734a1884382a0173e9a44784371858b5e5f137bf68b2b6193d0
data/.rubocop.yml CHANGED
@@ -3,6 +3,9 @@ AllCops:
3
3
  TargetRubyVersion: 2.5
4
4
  SuggestExtensions: false
5
5
 
6
+ Gemspec/RequireMFA:
7
+ Enabled: false
8
+
6
9
  Metrics/MethodLength:
7
10
  Enabled: false
8
11
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v3.0.1
4
+
5
+ * Fix pipelining with regards to redis-rb 4.6.0
6
+
3
7
  ## v3.0.0
4
8
 
5
9
  * Split `DistributedJob` in `DistributedJob::Client` and `DistributedJob::Job`
data/README.md CHANGED
@@ -86,9 +86,7 @@ class SomeBackgroundJob
86
86
 
87
87
  # ...
88
88
 
89
- distributed_job.done(part)
90
-
91
- if distributed_job.finished?
89
+ if distributed_job.done(part)
92
90
  # perform e.g. cleanup or the some other job
93
91
  end
94
92
  rescue
@@ -101,10 +99,9 @@ end
101
99
 
102
100
  The `#stop` and `#stopped?` methods can be used to globally stop a distributed
103
101
  job in case of errors. Contrary, the `#done` method tells the distributed job
104
- that the specified part has successfully finished. Finally, the `#finished?`
105
- method returns true when all parts of the distributed job are finished, which
106
- is useful to start cleanup jobs or to even start another subsequent distributed
107
- job.
102
+ that the specified part has successfully finished. The `#done` method returns
103
+ true when all parts of the distributed job have finished, which is useful to
104
+ start cleanup jobs or to even start another subsequent distributed job.
108
105
 
109
106
  That's it.
110
107
 
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_development_dependency 'rspec'
31
31
  spec.add_development_dependency 'rubocop'
32
- spec.add_dependency 'redis'
32
+ spec.add_dependency 'redis', '>= 4.1.0'
33
33
  end
@@ -24,9 +24,7 @@ module DistributedJob
24
24
  #
25
25
  # # ...
26
26
  #
27
- # distributed_job.done(part)
28
- #
29
- # if distributed_job.finished?
27
+ # if distributed_job.done(part)
30
28
  # # perform e.g. cleanup or the some other job
31
29
  # end
32
30
  # rescue
@@ -199,11 +197,11 @@ module DistributedJob
199
197
  # end
200
198
 
201
199
  def stop
202
- redis.multi do
203
- redis.hset("#{redis_key}:state", 'stopped', 1)
200
+ redis.multi do |transaction|
201
+ transaction.hset("#{redis_key}:state", 'stopped', 1)
204
202
 
205
- redis.expire("#{redis_key}:state", ttl)
206
- redis.expire("#{redis_key}:parts", ttl)
203
+ transaction.expire("#{redis_key}:state", ttl)
204
+ transaction.expire("#{redis_key}:parts", ttl)
207
205
  end
208
206
 
209
207
  true
@@ -245,11 +243,11 @@ module DistributedJob
245
243
  end
246
244
 
247
245
  def close
248
- redis.multi do
249
- redis.hset("#{redis_key}:state", 'closed', 1)
246
+ redis.multi do |transaction|
247
+ transaction.hset("#{redis_key}:state", 'closed', 1)
250
248
 
251
- redis.expire("#{redis_key}:state", ttl)
252
- redis.expire("#{redis_key}:parts", ttl)
249
+ transaction.expire("#{redis_key}:state", ttl)
250
+ transaction.expire("#{redis_key}:parts", ttl)
253
251
  end
254
252
 
255
253
  true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DistributedJob
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distributed_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Vetter
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 4.1.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 4.1.0
55
55
  description: Keep track of distributed jobs spanning multiple workers using redis
56
56
  email:
57
57
  - benjamin.vetter@wlw.de
@@ -83,7 +83,7 @@ metadata:
83
83
  homepage_uri: https://github.com/mrkamel/distributed_job
84
84
  source_code_uri: https://github.com/mrkamel/distributed_job
85
85
  changelog_uri: https://github.com/mrkamel/distributed_job/blob/master/CHANGELOG.md
86
- post_install_message:
86
+ post_install_message:
87
87
  rdoc_options: []
88
88
  require_paths:
89
89
  - lib
@@ -98,8 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.0.3
102
- signing_key:
101
+ rubygems_version: 3.3.3
102
+ signing_key:
103
103
  specification_version: 4
104
104
  summary: Keep track of distributed jobs using redis
105
105
  test_files: []