resque-batched-job 1.7.2 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque/plugins/batched_job/version.rb +1 -1
- data/lib/resque/plugins/batched_job.rb +7 -5
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94cdc6d1af8d3710cf34bcb94e9e2167906a628e
|
4
|
+
data.tar.gz: 533f0bc8a792f543d3f37ca012bdf2eab8ce72b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189450674bb947705a29f7282ec18861e6ff15d2e96561569cdb3be78d50a0b8d42c9df3c0aa0fae33aeca33d8d3a65db8db7e0e2e4cd763c8641c1c5a6ccb7c
|
7
|
+
data.tar.gz: 47e4b055215dc8c076839b7fc297cd084b8e322fe81819422cf4a395c59e046b5a9a55fdc29554ed66f3190d8d925d04d4a8487cd4c8bb9d4c4410b47310a99e
|
@@ -20,8 +20,6 @@ module Resque
|
|
20
20
|
|
21
21
|
module BatchedJob
|
22
22
|
|
23
|
-
include Resque::Helpers
|
24
|
-
|
25
23
|
# Helper method used to generate the batch key.
|
26
24
|
#
|
27
25
|
# @param [Object, #to_s] id Batch identifier. Any Object that responds to #to_s
|
@@ -35,7 +33,7 @@ module Resque
|
|
35
33
|
# @param [Object, #to_s] id Batch identifier. Any Object that responds to #to_s
|
36
34
|
def after_enqueue_batch(id, *args)
|
37
35
|
mutex(id) do |bid|
|
38
|
-
redis.rpush(bid, encode(:class => self.name, :args => args))
|
36
|
+
redis.rpush(bid, Resque.encode(:class => self.name, :args => args))
|
39
37
|
end
|
40
38
|
end
|
41
39
|
|
@@ -85,7 +83,7 @@ module Resque
|
|
85
83
|
# @param id (see Resque::Plugins::BatchedJob#after_enqueue_batch)
|
86
84
|
def remove_batched_job(id, *args)
|
87
85
|
mutex(id) do |bid|
|
88
|
-
redis.lrem(bid, 1, encode(:class => self.name, :args => args))
|
86
|
+
redis.lrem(bid, 1, Resque.encode(:class => self.name, :args => args))
|
89
87
|
redis.llen(bid)
|
90
88
|
end
|
91
89
|
end
|
@@ -106,7 +104,7 @@ module Resque
|
|
106
104
|
bid = batch(id)
|
107
105
|
regexp = /\A\{\"class\":\"#{self.name}\",\"args\":\[/
|
108
106
|
redis.lrange(bid, 0, redis.llen(bid)-1).grep(regexp).map do |string|
|
109
|
-
payload = decode(string)
|
107
|
+
payload = Resque.decode(string)
|
110
108
|
payload['args'].unshift(id)
|
111
109
|
Resque::Job.new(@queue, payload)
|
112
110
|
end
|
@@ -124,6 +122,10 @@ module Resque
|
|
124
122
|
|
125
123
|
private
|
126
124
|
|
125
|
+
def redis
|
126
|
+
Resque.redis
|
127
|
+
end
|
128
|
+
|
127
129
|
# Lock a batch key before executing Redis commands. This will ensure
|
128
130
|
# no race conditions occur when modifying batch information. Here is
|
129
131
|
# an example of how this works. See http://redis.io/commands/setnx for
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-batched-job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resque
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.25.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.25.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: turn
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,8 +84,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.0.
|
87
|
+
rubygems_version: 2.0.14
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Resque plugin
|
91
91
|
test_files: []
|
92
|
+
has_rdoc:
|