delayed_job_extras 0.9.15 → 0.9.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/delayed_job_extras/extras.rb +6 -19
- data/lib/delayed_job_extras/job.rb +1 -1
- metadata +1 -1
@@ -7,25 +7,6 @@ module Delayed
|
|
7
7
|
def self.included(klass)
|
8
8
|
klass.send(:include, Delayed::Job::Extras::InstanceMethods)
|
9
9
|
klass.extend(Delayed::Job::Extras::ClassMethods)
|
10
|
-
klass.class_eval do
|
11
|
-
class << self
|
12
|
-
def new_with_extras(*args)
|
13
|
-
begin
|
14
|
-
klass = new_without_extras(*args)
|
15
|
-
rescue ArgumentError => e
|
16
|
-
if e.message == 'wrong number of arguments (1 for 0)'
|
17
|
-
klass = new_without_extras
|
18
|
-
else
|
19
|
-
raise e
|
20
|
-
end
|
21
|
-
end
|
22
|
-
klass.__original_args = *args
|
23
|
-
return klass
|
24
|
-
end
|
25
|
-
|
26
|
-
alias_method_chain :new, :extras
|
27
|
-
end
|
28
|
-
end
|
29
10
|
end
|
30
11
|
|
31
12
|
module InstanceMethods
|
@@ -72,6 +53,12 @@ module Delayed
|
|
72
53
|
false
|
73
54
|
end
|
74
55
|
|
56
|
+
def clone
|
57
|
+
cl = super
|
58
|
+
cl.run_at = nil
|
59
|
+
cl
|
60
|
+
end
|
61
|
+
|
75
62
|
end # InstanceMethods
|
76
63
|
|
77
64
|
module ClassMethods
|
@@ -47,7 +47,7 @@ module Delayed
|
|
47
47
|
|
48
48
|
def enqueue_again
|
49
49
|
if self.payload_object.re_enqueuable
|
50
|
-
new_worker = self.payload_object.
|
50
|
+
new_worker = self.payload_object.clone()
|
51
51
|
if self.payload_object.__re_enqueue_block
|
52
52
|
self.payload_object.__re_enqueue_block.call(self.payload_object, new_worker)
|
53
53
|
end
|