rjob 0.5.2 → 0.5.3

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: 3499587dfa6fa5db867d088dfc0f48757a204df0cd07a252c3f880ce827effe6
4
- data.tar.gz: 6ff88dc58d9e39eb337980b4fe1241bd3afb493cd15aff370ab463e4b2d086b6
3
+ metadata.gz: 364e6b6c660f7b3fc31a24a1bd86942a7900aed84146ecf0a5fa3799653966b9
4
+ data.tar.gz: d450f1b80a5854b59d49c9bd9ca3f8df1c05b4dffe5d7e202efb95d15740e5e9
5
5
  SHA512:
6
- metadata.gz: 77d9c95f465434e5efc942b5dca1a98c64bc2f15c2c12691b258f993569c68c29f1146958e8856633e9bee32bcc82119d687b3ee37a29eb6fa5163238eeacf08
7
- data.tar.gz: 523ff1e067f99d9fb632c248d7b07157112d0d6197574e717d319900f76e8c646698f692388760dccb521abfbf36f88fe01b5c01614ec71f0b28fcf7319c5a71
6
+ metadata.gz: 2c2f0b54f42c2eaa8aac6b2b09dcb12adffce5763be7d89878971c9afc22460f73b4728f1bab42756fbf13bb4fe92d47a86f7ae41e759710faca153f958e861d
7
+ data.tar.gz: 06e74cef1bb61d06eaaa005dcf13be78465d016308025fde8af8a7035259645aadbbc2561fbf68db8745465500525495342ecd30db94915f4501dc2a09b4e0f2
@@ -14,7 +14,7 @@ class Rjob::Scripts::EnqueueJob < Rjob::Scripts::RedisScript
14
14
  local job_id = r.call('incr', prefix .. ':next')
15
15
  local bucket = job_id % bucket_count
16
16
  r.call('lpush', prefix .. ':jobs:' .. bucket, job_id .. '!0!' .. job_data)
17
- r.call('publish', prefix .. ':jobs', bucket)
17
+ r.call('publish', prefix .. ':jobs', tostring(bucket))
18
18
  return job_id
19
19
  LUA
20
20
  end
@@ -14,7 +14,7 @@ class Rjob::Scripts::ScanBuckets < Rjob::Scripts::RedisScript
14
14
  for i=0,bucket_count-1 do
15
15
  local len = r.call('llen', prefix .. ':jobs:' .. i)
16
16
  if len > 0 then
17
- r.call('publish', prefix .. ':jobs', i)
17
+ r.call('publish', prefix .. ':jobs', tostring(i))
18
18
  end
19
19
  end
20
20
  return 1
data/lib/rjob/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rjob
3
- VERSION = "0.5.2".freeze
3
+ VERSION = "0.5.3".freeze
4
4
  end
@@ -81,12 +81,10 @@ class Rjob::WorkerProcess
81
81
  begin
82
82
  @pubsub_redis.subscribe("#{@prefix}:jobs") do |on|
83
83
  on.message do |_, bucket_no|
84
- loop do
85
- break unless @state == :running
84
+ @pubsub_redis.unsubscribe unless @state == :running
86
85
 
87
- @subscription_mutex.synchronize do
88
- break unless start_processing_message_from_bucket(bucket_no)
89
- end
86
+ @subscription_mutex.synchronize do
87
+ start_processing_message_from_bucket(bucket_no)
90
88
  end
91
89
  end
92
90
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - André D. Piske
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-08 00:00:00.000000000 Z
11
+ date: 2022-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -131,7 +131,7 @@ homepage: https://gitlab.com/andrepiske/rjob
131
131
  licenses:
132
132
  - Apache-2.0
133
133
  metadata: {}
134
- post_install_message:
134
+ post_install_message:
135
135
  rdoc_options: []
136
136
  require_paths:
137
137
  - lib
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubygems_version: 3.3.11
150
- signing_key:
150
+ signing_key:
151
151
  specification_version: 4
152
152
  summary: Asynchronous job processing
153
153
  test_files: []