resque-job-tracking 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -63,7 +63,7 @@ module Resque
|
|
63
63
|
identifiers = track(*jobargs)
|
64
64
|
if self.respond_to?(:extra_meta_on_start)
|
65
65
|
meta = get_meta(meta_id)
|
66
|
-
meta.data.merge!(self.extra_meta_on_start)
|
66
|
+
meta.data.merge!(self.extra_meta_on_start(*jobargs))
|
67
67
|
meta.save
|
68
68
|
end
|
69
69
|
identifiers.each do |ident|
|
data/spec/tracking_spec.rb
CHANGED
@@ -83,10 +83,11 @@ class JobOnHost < BaseJobWithPerform
|
|
83
83
|
def perform(account_id)
|
84
84
|
end
|
85
85
|
|
86
|
-
def self.extra_meta_on_start
|
86
|
+
def self.extra_meta_on_start(account_id)
|
87
87
|
{
|
88
88
|
'hostname' => "foo",
|
89
|
-
'pid' =>
|
89
|
+
'pid' => $$,
|
90
|
+
'account_id' => account_id
|
90
91
|
}
|
91
92
|
end
|
92
93
|
|
@@ -184,6 +185,7 @@ describe TypicalProblemJob do
|
|
184
185
|
meta_data["hostname"].should eq "foo"
|
185
186
|
meta_data["pid"].should_not be_nil
|
186
187
|
meta_data["pid"].should_not eq $$
|
188
|
+
meta_data["account_id"].should eq account.id
|
187
189
|
end
|
188
190
|
|
189
191
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-job-tracking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jacob Burkhart
|