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 +4 -4
- data/lib/rjob/scripts/enqueue_job.rb +1 -1
- data/lib/rjob/scripts/scan_buckets.rb +1 -1
- data/lib/rjob/version.rb +1 -1
- data/lib/rjob/worker_process.rb +3 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 364e6b6c660f7b3fc31a24a1bd86942a7900aed84146ecf0a5fa3799653966b9
|
4
|
+
data.tar.gz: d450f1b80a5854b59d49c9bd9ca3f8df1c05b4dffe5d7e202efb95d15740e5e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/rjob/worker_process.rb
CHANGED
@@ -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
|
-
|
85
|
-
break unless @state == :running
|
84
|
+
@pubsub_redis.unsubscribe unless @state == :running
|
86
85
|
|
87
|
-
|
88
|
-
|
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.
|
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-
|
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: []
|